Geode::Line
Inherits Reference < Object
The Line class represents a two-dimensional line with no defined endpoints.
For a line with endpoints, see the Segment class.
Constructors
Class methods
perpendicular?(l1 : Line, l2 : Line)
Returns whether the two given lines are perpendicular to each other.
Instance methods
==(other : self)
Returns true if this reference is the same as other. Invokes same?.
hash(hasher)
See Object#hash(hasher)
to_s(io : IO)
Returns a string representation of the line in slope-intercept form (y = mx + b).
A vertical line will return a string in the form x = c where c is the line's x-intercept.
x_intercept
Returns the x-intercept of the line. If the line is horizontal, it has no x-intercept, so it returns nil.
y_intercept
Returns the y-intercept of the line. If the line is vertical, it has no y-intercept, so it returns nil.