The Solar-Stellar Spectrograph

[ Home | About | Tech Info & Data | Publications | References ]      [ Site by Jeffrey Hall | Research funded by NSF ]

ARTICLE

Coord

The Coord class implements defintion of and operations on an x-y coordinate. Two Coord objects are used to define the corners of a rectangle in the Rect class, and many of that class's methods call methods of this class. Since Obj_Destroy by itself will take care of destroying this object, it does not define its own Cleanup method.

Version History

2008 July 17 - Documentation written.

 

Data Members

float x

float y

 

Method List

define

diff( )

equals( )

get( )

init( )

magnitude( )

set

 

Method Descriptions

 

PRO define

Structure definition. Specifies the contents of the IDL structure instantiated by the Coord class. Used by Obj_New; do not invoke directly.

 

FUNCTION diff

argument variant vals

Return float[2] diff

Returns the difference between two coordinates as a two-element float. The x and y values given by the arguments are subtracted from the values of the object's data members and the difference returned. This method can also accept an object as an argument. If an object is passed, the method expects that it has a get method that will return a coordinate for comparison.

 

FUNCTION equals

argument variant vals

Return bool TRUE, FALSE

Returns TRUE is the x and y values in the arguments are the same as those in the Coord object, and FALSE otherwise. This method can also accept an object as an argument. If an object is passed, the method expects that it has a get method that will return a coordinate for comparison.

 

FUNCTION get

Return float[ 2 ] [x, y]

Returns the object's data members as a two-element float.

 

FUNCTION init

argument float x

argument float y

Return bool TRUE

Constructor. The arguments specify the coordinate's x and y values. Never call this function directly; it is invoked by IDL's Obj_New function.

 

FUNCTION magnitude

Return float mag

Returns the magnitude of the coordinate (i.e., the length of a vector between it and the origin).

 

PRO set

argument float[2] set

Sets the values of the object's data members.

 

Sample Usage

obj = Obj_New( 'Coord', 6.0, 8.0 )

Obj_Destroy( obj )

 


[Back to contents]

Supported by grants from the National Science Foundation.
[ Back to my home page | Email me: jch [at] lowell [dot] edu ]
The SSS is publicly funded. Unless explicitly noted otherwise, everything on this site is in the public domain.
If you use or quote our results or images, we appreciate an acknowledgment.
This site is best viewed with Mozilla Firefox.