PHPackages                             nessworthy/decasteljau - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. nessworthy/decasteljau

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

nessworthy/decasteljau
======================

A stupid way of using De Casteljau's algorithm to calculate control points of a segment in a cubic bezier curve.

1.0.0(7y ago)019WTFPLPHP

Since Jul 18Pushed 7y ago1 watchersCompare

[ Source](https://github.com/Nessworthy/DeCasteljau)[ Packagist](https://packagist.org/packages/nessworthy/decasteljau)[ RSS](/packages/nessworthy-decasteljau/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (2)Used By (0)

Nessworthy / decasteljau
========================

[](#nessworthy--decasteljau)

A stupid way of using [De Casteljau's algorithm](https://en.wikipedia.org/wiki/De_Casteljau's_algorithm) to calculate control points of a segment in a cubic bezier curve in PHP.

I used this a fair amount when trying to work out segments for SVG paths.

Requirements
------------

[](#requirements)

- PHP 7

Installation
------------

[](#installation)

`composer require nessworthy/decasteljau`

Usage
-----

[](#usage)

The algorithm requires 6 pieces of information - the original 4 control points of your bezier curve, where you want to cut your segment, and how long you want your segment to be.

Example:

```
