Page 8 out of 78 total pages , Page 5 out of 12 pages in this chapter


2.8 Ordinate Access

2.8.1 get

Usage:


#include <Level1/coord.h>
double get(int i)

Description:

The function get returns the current value of the ith ordinate. The value of i must be 0, 1, or 2.

Return Value:

A double.

Example:

#include <gamma.h>
main()
  {
  coord pt(5,6,7); 	 	 // Define a coordinate point.
  double y = pt.get(1); 	 	 // Set y to the value 6.
  }

See Also: x, y, z

2.8.2 x

2.8.3 y

2.8.4 z

Usage:


#include <Level1/coord.h>
double coord::x ()
double coord::x (double u1)
double coord::y ()
double coord::y (double u2)
double coord::z ()
double coord::z (double u3)

Description:

The functions x, y, and z are used to either obtain or set the first individual ordinates of a coordinate point. If no argument is given the function will return the requested ordinate whereas if a value is specified the oridinate will be set to that value. Although labeled x, y, and z these deal with the 1st, 2nd, and 3rd ordinates respectively (and only x,y, & z in a Cartesian system).

Return Value:

A double precision number is returned.

Examples:

#include <gamma.h>
main()
  {
  coord pt(1,-3,7); 	 	 // Construct coordinate pt {1, -3, 7}.
  cout << pt.x(); 	 	 // Write the first ordinate of pt, 1, to standard output.
  pt.x(3); 	 	 // Set the first ordinate of pt to 3: {3,-3,7}.
  double tmp = 3 * pt.y(); 	 	 // Set variable tmp to 3*-3, where -3 is 2nd ordinate.
  pt.y(1);	 	 // Set the second ordinate of pt to 1: {3, 1, 7}.
  double tmp = 5 + pt.z(); 	 	 // Set temp to 5+7, 7 being the 3rd ordinate of pt
  pt.z(-1);	 	 // Set the 3rd ordinate of pt to -1: {3, 1, -1}
  }

See Also: get, xyz

2.8.5 xyz

Usage:


#include <Level1/coord.h>
void coord::xyz (double u1, double u2, double u3)
void coord::xyz (coord & pt)

Description:

The function xyz sets the values of the three ordinates of a coordinate point.
  1. coord.xyz(double u1, double u2, double u3) - sets the ordinates to u1, u2, and u3 respectively.
  2. coord.xyz(coord &pt) - sets the components of the coordinate equal to those of coordinate pt.

Return Value:

None, the function is void.

Examples:

#include <gamma.h>
main()
  {
  coord pt, pt1; 	 	 // Create two empty points, pt and pt1.
  pt.xyz(-11,0,7); 	 	 // Set pt coordinates {-11, 0, 7}.
  pt1.xyz(pt); 	 	 // Set pt1 coordinates equal to those of pt {-11, 0, 7}.
  }

See Also: x, y, z, coord, =




Page 8 out of 78 total pages , Page 5 out of 12 pages in this chapter


GAMMA Support Provided by the National High Magnetic Field Laboratory
© 1996 Scott A. Smith, The NHMFL, and The Florida State University.
All Rights Reserved.
No GAMMA WWW pages or GAMMA specific images therein may be reproduced or used in any manner outside of personal Web Browsers without permission from the copyright holders.
Send problems & suggestions to gamma@magnet.fsu.edu
Additonal GAMMA information can be found at http://gamma.magnet.fsu.edu