Springz::Point (Class)

In: Springz.rb
Parent: Object

A simple 2-d point.

Used by the springz_loc property of the Springz::ObjectInterface module to track and control where the object is.

Methods

Attributes

x  [RW]  The Cartesian location of the point.
y  [RW]  The Cartesian location of the point.

Public Class methods

Create a new point at the specified x and y coordinates.

Public Instance methods

Returns three values:

  • the distance between this point and other_point (same as distance_to)
  • the difference along the x-axis
  • the difference along the y-axis

Returns the distance between this point and other_point.

Moves the point to the specified coordinate pair. (Shorthand for p.x=x; p.y=y;)

[Validate]