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

Direction3 objects. The following section details the constructors, properties, and<br />

methods available using Line3 as example.<br />

Each line type has multiple constructors. The following examples use the Line3 class<br />

constructors.<br />

Here is construction from two points.<br />

// Define points for the line<br />

Point3 first = new Point3(10.0, 10.0, 10.0);<br />

Point3 last = new Point3(20.0, 20.0, 20.0);<br />

// Create the line<br />

Line3 myLine = new Line3(first, last);<br />

This is construction from a point and a direction.<br />

Point3 point = new Point3(10.0, 20.0, 40.0);<br />

Direction3 direction = new Direction3(10.0, 10.0, 0.0);<br />

public Line3 (point, direction);<br />

Use a copy constructor to create a copy of an existing Line.<br />

Line3 anotherLine = new Line3( myLine );<br />

The public properties for the line classes include (Line3 for example):<br />

IsDegenerate - This property returns true if the line is degenerated to a point, i.e. if<br />

the direction of the line is Direction2.Zero.<br />

Point3 p1 = new Point3(10,10,10);<br />

Line3 l1 = new Line3(p1, p1);<br />

bool result = l1.IsDegenerate;<br />

//result is true<br />

Direction3 d1 = new Direction3(5,5,5);<br />

Line3 l2 = new Line3(p1,d1);<br />

result = l2.IsDegenerate;<br />

//result is false<br />

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

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

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

Saved successfully!

Ooh no, something went wrong!