struct

CG2d::Line(T)

Inherits Struct < Value < Object

T may be any subtype of Vec(T) i.g. Line(Int32)

Constructors

new(p1 : Vec(T), p2 : Vec(T))
Source

Instance methods

/(n : Float | Int)
Source
bottom
Source
contains_y?(y)
Source
inv_slope
Source
left
Source
length

Return the length of the line

Source
lerp(t : Float64)

Linearly interpolate

Source
normal

Find the normal axis to this line

Source
normal_cc

Normal counter clockwise

Source
p1=(p1 : Vec(T))
Source
p2=(p2 : Vec(T))
Source
right
Source
rise

The height from the starting point to the ending point

Source
run

The length from the starting point to the ending point

Source
slope
Source
to_vector

Convert this line into a normalized vector

Source
x_at(y)
Source
y_at(x)
Source