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 />

Begin - This property gets the point at the beginning of the segment.<br />

Segment3 seg = new Segment3(new Point3 (1, 2, 3),<br />

new Point3 (5, 10, 15));<br />

Point3 pt = seg.Begin;<br />

//result is pt(1, 2, 3)<br />

End - This property gets the point at the end of the segment.<br />

Segment3 seg = new Segment3(new Point3 (1, 2, 3),<br />

new Point3 (5, 10, 15));<br />

Point3 pt = seg.End;<br />

//result is pt(5, 10, 15)<br />

IsDegenerate - This property returns true if the segment is degenerated to a point.<br />

This would occur if the segment was constructed with a length of 0, from a pair of<br />

identical points, or from a vector with no length.<br />

Segment3 seg = new Segment3(new Point3 (1, 2, 3),<br />

new Point3 (5, 10, 15));<br />

bool result = seg.IsDegenerate;<br />

//result is false<br />

Length – The length of the segment defined by the distance between the beginning and<br />

ending points.<br />

Segment3 seg = new Segment3(newPoint3(0, 0, 0), new Point3 (3, 0, 4));<br />

//segment in X,Z plane<br />

double length = seg.Length;<br />

//length = 5<br />

Vector - This property gets the vector displacement from the beginning point to the<br />

ending point. This is the difference between the ending point X, Y, Z values and the<br />

corresponding beginning points X, Y, Z values.<br />

Segment3 seg = new Segment3(new Point3 (1, 2, 3),<br />

new Point3 (5, 10, 15));<br />

Vector3 vec = seg.Vector;<br />

//vec is (4,8,12)<br />

The segment classes define the public fields:<br />

4-164 <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!