02.05.2014 Views

CoreandServices.book - Ocean - Schlumberger

CoreandServices.book - Ocean - Schlumberger

CoreandServices.book - Ocean - Schlumberger

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Geometry<br />

object, i.e. two values for a Point2 and three values for a Point3. Otherwise an exception is<br />

raised. The Point Operator for Point3 is defined as:<br />

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

Given an array containing the values {10, 20, 30}, the Point3 object created will have a<br />

value of 10 for X, 20 for Y, and 30 for Z.<br />

double[] dbArray = new double[] { 10.0, 20.0, 30.0 };<br />

Point3 pt3 = (Point3)dbArray;<br />

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

The Point2 and Point3 classes also define a set of public methods for converting<br />

between Cartesian and polar coordinates.<br />

GetCartesianFromPolar – This method computes a Point object in Cartesian<br />

coordinate space from an input of polar coordinates. The Point3 method has the<br />

following definition:<br />

public static void GetCartesianFromPolar(<br />

Angle theta,<br />

Angle phi,<br />

double rho,<br />

out double x,<br />

out double y,<br />

out double z<br />

);<br />

“Theta” is an Angle object that represents the angle in Cartesian space between the X<br />

axis and the line connecting the origin to the point projected onto the XY plane. The<br />

Angle object “phi” represents the angle between the XY plane and the line connecting<br />

the origin to the point. The value “rho” is the length of the line connecting the 3D origin<br />

to the point.<br />

The method has three output parameters: double x, double y, and double z. These<br />

values define the Cartesian coordinate for the point location.<br />

4-138 <strong>Ocean</strong> Application Development Framework 2008.1<br />

<strong>Schlumberger</strong> Private

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

Saved successfully!

Ooh no, something went wrong!