02.05.2014 Views

CoreandServices.book - Ocean - Schlumberger

CoreandServices.book - Ocean - Schlumberger

CoreandServices.book - Ocean - Schlumberger

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Geometry<br />

!= Operator - This operation compares two points for inequality. Inequality is defined by<br />

any property of one point not equaling the corresponding property of the other point.<br />

Point3 pt1 = new Point3(10, 20, 30);<br />

Point3 pt2 = new Point3(20, 30, 40);<br />

Point3 pt3 = new Point3(10, 20, 30);<br />

bool result = (pt1 != pt2);<br />

//result is true<br />

result = (pt1 != pt3);<br />

//result is false<br />

== Operator - This operation compares two point instances for equality. Equality is defined<br />

by all properties of one point being equal to the corresponding properties of the other<br />

point. X equals X, Y equals Y, and Z equals Z.<br />

Point3 pt1 = new Point3(10, 20, 30);<br />

Point3 pt2 = new Point3(20, 30, 40);<br />

Point3 pt3 = new Point3(10, 20, 30);<br />

bool result = (pt1 == pt2);<br />

//result is false<br />

result = (pt1 == pt3);<br />

//result is true<br />

double Operator – This operation will convert a Point object to an implicit array of<br />

doubles. The returned array will contain the properties of the Point in the order X, Y,<br />

and Z. The array size will be adjusted up or down to match the size of the Point object.<br />

The definition for the operator is:<br />

public static implicit [ ] operator double(Point3 arg);<br />

Given a Point3 defined to contain an X of 10, Y of 20, and Z of 30, the double<br />

representation will be an array of {10, 20, 30}.<br />

Point3 pt1 = new Point3(10, 20, 30);<br />

double[ ] dbArray = pt1;<br />

//dbArray = { 10.0, 20.0, 30.0 }<br />

Point Operator (Point2 or Point3) – The Point operator will explicitly cast an<br />

array of doubles to a Point object. The values in the array will be defined as the X, Y,<br />

and Z properties respectively. The array size must match the dimension of the Point<br />

<strong>Schlumberger</strong> Private<br />

<strong>Ocean</strong> Services 4-137

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!