Class Point (version 0.18)

Description: An integer point class

Class overview

Index

Method Overview

[static] Point from_dpoint( DPoint p )Create a double point from an integer point
[static] Point newDefault constructor: creates a point at 0,0
[static] Point new( int x, int y )Constructor for a point from two coordinate values
[const] Point +( Point p )Add one point to another
[const] Point -( Point p )Subtract one point from another
[const] bool <( Point p )"less" comparison operator
[const] bool ==( Point p )Equality test operator
[const] bool !=( Point p )Inequality test operator
[const] int xAccessor to the x coordinate
[const] int yAccessor to the y coordinate
x=( int )Write accessor to the x coordinate
y=( int )Write accessor to the y coordinate
[const] Point *( double f )Scaling by some factor
[const] double distance( Point d )The euclidian distance to another point
[const] double sq_distance( Point d )The square euclidian distance to another point
[const] string to_sString conversion
assign( Point other )Assign the contents of another object to self
[const] Point dupCreates a copy of self.
destroyExplicitly destroy the object
[const] bool destroyedTell, if the object was destroyed

[const] bool !=( Point p )

Description: Inequality test operator

[const] Point *( double f )

Description: Scaling by some factor

Scaling may involve rounding for integer coordinate points.

[const] Point +( Point p )

Description: Add one point to another

Add point p to self by adding the coordinates

[const] Point -( Point p )

Description: Subtract one point from another

Subtract point p from self by subtracting the coordinates

[const] bool <( Point p )

Description: "less" comparison operator

This operator is provided to establish a sorting order

[const] bool ==( Point p )

Description: Equality test operator

assign( Point other )

Description: Assign the contents of another object to self

This method assigns the contents of another object to self. This is a deep copy that does not only copy the reference but the actual content.

destroy

Description: Explicitly destroy the object

Explicitly destroy the object on C++ side if it was owned by the Ruby interpreter. Subsequent access to this object will throw an exception. If the object is not owned by Ruby, this method will do nothing.

[const] bool destroyed

Description: Tell, if the object was destroyed

This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

[const] double distance( Point d )

Description: The euclidian distance to another point

d:The other point to compute the distance to.

[const] Point dup

Description: Creates a copy of self.

[static] Point from_dpoint( DPoint p )

Description: Create a double point from an integer point

Creates an double point from an integer point p

[static] Point new( int x, int y )
synonym: [static] Point new_xy( int x, int y )

Description: Constructor for a point from two coordinate values

[static] Point new

Description: Default constructor: creates a point at 0,0

[const] double sq_distance( Point d )

Description: The square euclidian distance to another point

d:The other point to compute the distance to.

[const] string to_s

Description: String conversion

[const] int x

Description: Accessor to the x coordinate

x=( int )

Description: Write accessor to the x coordinate

[const] int y

Description: Accessor to the y coordinate

y=( int )

Description: Write accessor to the y coordinate