Math::Point

This is the Math::Point class.

Represents a 2D point.

Initializer

$pt = Point($x: Num, $y: Num)

Creates a point given x- and y- coordinates.

  • x: Num - X-coordinate.

  • y: Num - Y-coordinate.

Methods

distanceTo

$pt.distanceTo($pt2: Point)

Returns the distance between this point and another.

  • pt2: Point

midpoint

$pt.midpoint($pt2: Point)

Given another point, returns the point centered between them.

  • pt2: Point

distanceFromOrigin

$pt.distanceFromOrigin

Computed property. Distance between this point and the origin (0, 0).

Equality operator (==)

$pt == ($ehs: Point)

Equality of two points.

Class properties

origin

Point.origin

The point (0,0).

End of the Math::Point class.

This file was generated automatically by the Ferret compiler from Point.frt.