struct CG2d::Line(T)

Overview

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

Defined in:

cg2d/line.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(p1 : Vec(T), p2 : Vec(T)) #

[View source]

Instance Method Detail

def /(n : Float | Int) #

[View source]
def bottom #

[View source]
def contains_y?(y) #

[View source]
def inv_slope #

[View source]
def left #

[View source]
def length #

Return the length of the line


[View source]
def lerp(t : Float64) #

Linearly interpolate


[View source]
def normal #

Find the normal axis to this line


[View source]
def normal_cc #

Normal counter clockwise


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

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

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

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

[View source]
def right #

[View source]
def rise #

The height from the starting point to the ending point


[View source]
def run #

The length from the starting point to the ending point


[View source]
def slope #

[View source]
def to_vector #

Convert this line into a normalized vector


[View source]
def top #

[View source]
def x_at(y) #

[View source]
def y_at(x) #

[View source]