struct PF2d::Line(T)

Overview

Represents a line between two points Line(Vec2(Int32))

Defined in:

pf2d/line.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from struct PF2d::Points(2)

initialize initialize

Constructor methods inherited from struct PF2d::Points(2)

new new

Constructor Detail

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

Represents a line between two points Line(Vec2(Int32))


[View source]

Class Method Detail

def self.[](p1 : T, p2 : T) #

Represents a line between two points Line(Vec2(Int32))


[View source]

Instance Method Detail

def %(other) #

Applies % to all points of this shape


[View source]
def &*(other) #

Applies &* to all points of this shape


[View source]
def &+(other) #

Applies &+ to all points of this shape


[View source]
def *(other) #

Applies #* to all points of this shape


[View source]
def **(other) #

Applies #** to all points of this shape


[View source]
def +(other) #

Applies #+ to all points of this shape


[View source]
def -(other) #

Applies #- to all points of this shape


[View source]
def - #

Represents a line between two points Line(Vec2(Int32))


[View source]
def /(other) #

Applies #/ to all points of this shape


[View source]
def //(other) #

Applies #// to all points of this shape


[View source]
def abs #

Represents a line between two points Line(Vec2(Int32))


[View source]
def bounding_rect #

Represents a line between two points Line(Vec2(Int32))


[View source]
def ceil #

Represents a line between two points Line(Vec2(Int32))


[View source]
def centroid #

Represents a line between two points Line(Vec2(Int32))


[View source]
def contains_y?(y) #

[View source]
def direction #

[View source]
def floor #

Represents a line between two points Line(Vec2(Int32))


[View source]
def intersect?(other : Line) #

Return the point where the two lines intersect unless parallel


[View source]
def inv_slope #

[View source]
def length #

Return the length of the line


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

Linearly interpolate


[View source]
def max_x #

Represents a line between two points Line(Vec2(Int32))


[View source]
def max_y #

Represents a line between two points Line(Vec2(Int32))


[View source]
def max_z #

Represents a line between two points Line(Vec2(Int32))


[View source]
def min_x #

Represents a line between two points Line(Vec2(Int32))


[View source]
def min_y #

Represents a line between two points Line(Vec2(Int32))


[View source]
def min_z #

Represents a line between two points Line(Vec2(Int32))


[View source]
def normal #

Find the normal axis to this line


[View source]
def normal_cc #

Normal counter clockwise


[View source]
def p1 : T #

Represents a line between two points Line(Vec2(Int32))


def p1=(p1 : T) #

Represents a line between two points Line(Vec2(Int32))


def p2 : T #

Represents a line between two points Line(Vec2(Int32))


def p2=(p2 : T) #

Represents a line between two points Line(Vec2(Int32))


def point_pointers #

Represents a line between two points Line(Vec2(Int32))


[View source]
def points #

Represents a line between two points Line(Vec2(Int32))


[View source]
def rise #

The height from the starting point to the ending point


[View source]
def round(precision = 0) #

Represents a line between two points Line(Vec2(Int32))


[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 unbounded_intersect?(other : Line) #

Return the point where the two lines would intersect unless parallel


[View source]
def x_at(y) #

[View source]
def y_at(x) #

[View source]