struct PF2d::Bezier::Cubic(T)

Overview

Cubic bezier is a type of spline segment with 4 control points. The curve intersects points 0 and 3, while points 1 and 2 control the curve

For information on the implementation see https://pomax.github.io/bezierinfo

Defined in:

pf2d/bezier/cubic.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from struct PF2d::Bezier::Curve(T)

at(t : Float64) : Vec2(T) at, control_points : Tuple(Vec2(T), Vec2(T)) control_points, extrema(&) extrema, horizontal_intersects(y, &) horizontal_intersects, initialize initialize, length(steps : UInt32 = 10) length, normal(t : Float64) normal, points points, rect rect, tangent(t : Float64) tangent, x_values x_values, y_values y_values

Constructor methods inherited from struct PF2d::Bezier::Curve(T)

new new

Constructor Detail

def self.new(p0 : PF2d::Vec2(T), p1 : PF2d::Vec2(T), p2 : PF2d::Vec2(T), p3 : PF2d::Vec2(T)) #

[View source]

Class Method Detail

def self.cube_root(x : Number) #

[View source]
def self.derivative(t : Float64, p0 : Number, p1 : Number, p2 : Number, p3 : Number) #

The derivative represents the rate of change of the interpolation at t


[View source]
def self.extrema(p0 : Number, p1 : Number, p2 : Number, p3 : Number, &) #

Find the values that lie at the extrema of the function, i.e. where the rate of change is 0 these points are typically at the edges of a 2d curve


[View source]
def self.interpolate(t : Float64, p0 : Number, p1 : Number, p2 : Number, p3 : Number) #

Find the value at t along the curve (between 0.0 and 1.0)


[View source]
def self.roots(p0 : Number, p1 : Number, p2 : Number, p3 : Number, &) #

Solves roots so that t = 0


[View source]
def self.second_derivative(t : Float64, p0 : Number, p1 : Number, p2 : Number, p3 : Number) #

[View source]

Instance Method Detail

def control_points : Tuple(Vec2(T), Vec2(T)) #

[View source]
def p0 : Vec2(T) #

[View source]
def p0=(p0 : Vec2(T)) #

[View source]
def p1 : Vec2(T) #

[View source]
def p1=(p1 : Vec2(T)) #

[View source]
def p2 : Vec2(T) #

[View source]
def p2=(p2 : Vec2(T)) #

[View source]
def p3 : Vec2(T) #

[View source]
def p3=(p3 : Vec2(T)) #

[View source]
def point_pointers #

[View source]
def points #

[View source]
def to_f #

Cubic bezier is a type of spline segment with 4 control points. The curve intersects points 0 and 3, while points 1 and 2 control the curve

For information on the implementation see https://pomax.github.io/bezierinfo


[View source]
def to_f32 #

Cubic bezier is a type of spline segment with 4 control points. The curve intersects points 0 and 3, while points 1 and 2 control the curve

For information on the implementation see https://pomax.github.io/bezierinfo


[View source]
def to_f64 #

Cubic bezier is a type of spline segment with 4 control points. The curve intersects points 0 and 3, while points 1 and 2 control the curve

For information on the implementation see https://pomax.github.io/bezierinfo


[View source]
def to_i #

Cubic bezier is a type of spline segment with 4 control points. The curve intersects points 0 and 3, while points 1 and 2 control the curve

For information on the implementation see https://pomax.github.io/bezierinfo


[View source]
def to_i128 #

Cubic bezier is a type of spline segment with 4 control points. The curve intersects points 0 and 3, while points 1 and 2 control the curve

For information on the implementation see https://pomax.github.io/bezierinfo


[View source]
def to_i16 #

Cubic bezier is a type of spline segment with 4 control points. The curve intersects points 0 and 3, while points 1 and 2 control the curve

For information on the implementation see https://pomax.github.io/bezierinfo


[View source]
def to_i32 #

Cubic bezier is a type of spline segment with 4 control points. The curve intersects points 0 and 3, while points 1 and 2 control the curve

For information on the implementation see https://pomax.github.io/bezierinfo


[View source]
def to_i64 #

Cubic bezier is a type of spline segment with 4 control points. The curve intersects points 0 and 3, while points 1 and 2 control the curve

For information on the implementation see https://pomax.github.io/bezierinfo


[View source]
def to_i8 #

Cubic bezier is a type of spline segment with 4 control points. The curve intersects points 0 and 3, while points 1 and 2 control the curve

For information on the implementation see https://pomax.github.io/bezierinfo


[View source]
def to_u #

Cubic bezier is a type of spline segment with 4 control points. The curve intersects points 0 and 3, while points 1 and 2 control the curve

For information on the implementation see https://pomax.github.io/bezierinfo


[View source]
def to_u128 #

Cubic bezier is a type of spline segment with 4 control points. The curve intersects points 0 and 3, while points 1 and 2 control the curve

For information on the implementation see https://pomax.github.io/bezierinfo


[View source]
def to_u16 #

Cubic bezier is a type of spline segment with 4 control points. The curve intersects points 0 and 3, while points 1 and 2 control the curve

For information on the implementation see https://pomax.github.io/bezierinfo


[View source]
def to_u32 #

Cubic bezier is a type of spline segment with 4 control points. The curve intersects points 0 and 3, while points 1 and 2 control the curve

For information on the implementation see https://pomax.github.io/bezierinfo


[View source]
def to_u64 #

Cubic bezier is a type of spline segment with 4 control points. The curve intersects points 0 and 3, while points 1 and 2 control the curve

For information on the implementation see https://pomax.github.io/bezierinfo


[View source]
def to_u8 #

Cubic bezier is a type of spline segment with 4 control points. The curve intersects points 0 and 3, while points 1 and 2 control the curve

For information on the implementation see https://pomax.github.io/bezierinfo


[View source]