struct

Geode::Point

Inherits Enumerable < Struct < Value < Object

The Point struct represents a point on the 2-dimensional Cartesian plane.

Constructors

new(x : Number::Primitive = 0, y : Number::Primitive = 0)

Creates a new Point.

Source

Class methods

collinear?(p1 : Point, p2 : Point, p3 : Point)

Returns whether or not the three given points are collinear, i.e. whether a straight line could be drawn that passes through all three points.

Source

Instance methods

==(other : self)
each

Separately yields the x- and y-coordinates of the point.

Source
hash(hasher)

See Object#hash(hasher)

to_s(io : IO)

Returns a string representation of the point in the form (x, y).

Source
x

Returns the x-coordinate.

Source
y

Returns the y-coordinate.

Source