Point3D Struct Reference

A point in 3D space structure. More...

List of all members.

Public Member Functions

 Point3D (double x, double y, double z)
 Ctor.
 Point3D (Point3D p)
 Copy ctor.
 Point3D (double[] arr)
 Ctor.
void CopyTo (Point3D p)
 Copies this point to another.
override bool Equals (object p)
 Compares two points.
override string ToString ()
 String representation.
override int GetHashCode ()
 Hash code.
double[] ToArray ()
 Gets an array of 3 doubles.
void FromArray (object[] arr)
 Sets the point with coordinates from array of 3 doubles.

Static Public Member Functions

static bool operator== (Point3D g1, Point3D g2)
 Checks two points if they are equal in the terms of Equals method.
static bool operator!= (Point3D g1, Point3D g2)
 Checks two points for unequality in the terms of Equals method.
static bool DoublesEqual (double d1, double d2)
 Compares two doubles in the terms of Tolerance.
static bool PointsEqual (Point3D p1, Point3D p2)
 Compares two points.
static operator double[] (Point3D pt)
 Redirects to ToArray().
static Point3D operator- (Point3D pt1, Point3D pt2)
 Substraction.
static Point3D operator+ (Point3D pt1, Point3D pt2)
 Addition.
static Point3D operator * (double k, Point3D pt)
 Multiplication by number.
static double operator * (Point3D a, Point3D b)
 Scalar multiplication.
static Point3D[] ConvertArray (double[] arr)
 Builds an array of Point3D from an array of doubles.
static Point3D[] Convert2DArray (double[] arr)
 Builds an array of Point3D from 2D-array of doubles.

Properties

double X
 X.
double Y
 Y.
double Z
 Z.
static double Tolerance
 Gets or sets predefined tolerance.


Detailed Description

A point in 3D space structure.

Contains predefined tolerance property for equality operations.


Constructor & Destructor Documentation

Point3D double  x,
double  y,
double  z
 

Ctor.

Parameters:
x X
y Y
z Z

Point3D Point3D  p  ) 
 

Copy ctor.

Parameters:
p prototype

Point3D double[]  arr  ) 
 

Ctor.

Parameters:
arr array of 3 doubles


Member Function Documentation

void CopyTo Point3D  p  ) 
 

Copies this point to another.

Parameters:
p point to copy to

override bool Equals object  p  ) 
 

Compares two points.

Parameters:
p point
Returns:
true if the points are equal in the terms of Tolerance

static bool operator== Point3D  g1,
Point3D  g2
[static]
 

Checks two points if they are equal in the terms of Equals method.

Parameters:
g1 point
g2 point
Returns:
true if they are considered as equal

static bool operator!= Point3D  g1,
Point3D  g2
[static]
 

Checks two points for unequality in the terms of Equals method.

Parameters:
g1 point
g2 point
Returns:
true if they are considered as unequal

static bool DoublesEqual double  d1,
double  d2
[static]
 

Compares two doubles in the terms of Tolerance.

Parameters:
d1 double
d2 double
Returns:
true if they are considered as equal

static bool PointsEqual Point3D  p1,
Point3D  p2
[static]
 

Compares two points.

Equal method redirects here.

Parameters:
p1 point
p2 point
Returns:
true if the points are equal in the terms of Tolerance

override string ToString  ) 
 

String representation.

Returns:
i.e. "(2,5,8)"

override int GetHashCode  ) 
 

Hash code.

Returns:
what base method returns

double [] ToArray  ) 
 

Gets an array of 3 doubles.

Returns:
double array with X,Y,Z

void FromArray object[]  arr  ) 
 

Sets the point with coordinates from array of 3 doubles.

Parameters:
arr array of 3 doubles

static operator double[] Point3D  pt  )  [explicit, static]
 

Redirects to ToArray().

Parameters:
pt point
Returns:
array

static Point3D operator- Point3D  pt1,
Point3D  pt2
[static]
 

Substraction.

Parameters:
pt1 from
pt2 what
Returns:
difference

static Point3D operator+ Point3D  pt1,
Point3D  pt2
[static]
 

Addition.

Parameters:
pt1 item
pt2 item
Returns:
sum

static Point3D operator * double  k,
Point3D  pt
[static]
 

Multiplication by number.

Parameters:
k number
pt point
Returns:
product

static double operator * Point3D  a,
Point3D  b
[static]
 

Scalar multiplication.

Parameters:
a point
b point
Returns:
scalar product

static Point3D [] ConvertArray double[]  arr  )  [static]
 

Builds an array of Point3D from an array of doubles.

Parameters:
arr coordinates array
Returns:
points array

static Point3D [] Convert2DArray double[]  arr  )  [static]
 

Builds an array of Point3D from 2D-array of doubles.

Parameters:
arr 2D coordinates array
Returns:
points array with Z coordinate equal to zero


Property Documentation

double X [get, set]
 

X.

double Y [get, set]
 

Y.

double Z [get, set]
 

Z.

double Tolerance [static, get, set]
 

Gets or sets predefined tolerance.


Generated on Sun May 28 08:45:06 2006 for Acmx.Common documentation by  doxygen 1.4.5