beziers package

Submodules

beziers.cubicbezier module

class beziers.cubicbezier.CubicBezier(start, c1, c2, end)

Bases: beziers.segment.Segment

curvatureAtTime(t)
derivative()
findExtremes()
join(other)
length
normalAtTime(t)
pointAtTime(t)

Returns the point at time t (0->1) along the curve.

splitAtTime(t)

Returns two segments, dividing the given segment at a point t (0->1) along the curve.

tangentAtTime(t)
toQuadratic()

beziers.line module

class beziers.line.Line(start, end)

Bases: beziers.segment.Segment

Represents a line segment within a Bezier path.

bothPointsAreOnSameSideOfOrigin(b, c)
findExtremes()
intercept
intersection(other)
length
pointAtTime(t)

Returns the point at time t (0->1) along the line.

slope
splitAtTime(t)

Returns two segments, dividing the given segment at a point t (0->1) along the line.

beziers.point module

class beziers.point.Point(x, y)

Bases: object

A representation of a point within the Beziers world.

angle

Interpreting this point as a vector, returns the angle in radians of the vector.

clone()

Clone a point, returning a new object with the same co-ordinates.

distanceFrom(other)

Returns the Euclidean distance between this point and another.

classmethod fromAngle(angle)

Given an angle in radians, return a unit vector representing that angle.

lerp(other, t)

Interpolate between two points, at time t.

magnitude

Interpreting this point as a vector, returns the magnitude (Euclidean length) of the vector.

rotate(around, by)

Rotate a point around another point, by an angle given in radians.

squareDistanceFrom(other)

Returns the squared Euclidean distance between this point and another.

squareMagnitude

Interpreting this point as a vector, returns the squared magnitude (Euclidean length) of the vector.

toUnitVector()

beziers.segment module

class beziers.segment.Segment

Bases: object

align()
end
rotate(around, by)
start
translate(vector)

Module contents