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.

This is construction from two points, where one point is defined as the origin and the<br />

instance passes through the second point:<br />

Geometry<br />

Point3 origin = new Point3(0, 0, 0);<br />

Point3 point = new Point3( 100.0, 50.0, 75.0);<br />

Ray3 ray = new Ray3( origin, point);<br />

The copy constructor that creates a copy of an existing ray looks like:<br />

Ray3 myRay = new Ray3(originlRay);<br />

The public properties for the Ray2 and Ray3 classes include:<br />

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

Direction - This property returns the direction of the ray.<br />

Origin - This property returns the origin point of the ray.<br />

Point3 originPt = new Point3(5, 5, 5);<br />

Direction3 rayDi = new Direction3(3,3,3);<br />

Ray3 r = new Ray3(originPt, rayDi);<br />

bool result = r.IsDegenerate;<br />

//result is false<br />

Ray3 r2 = new Ray3(originPt, Direction3.Zero);<br />

bool result = r2.IsDegenerate;<br />

//result is true<br />

The Ray2 and Ray3 classes define the public field:<br />

Null - The undefined ray has an undefined origin and undefined direction.<br />

Ray3 r3 = Ray3.Null;<br />

Ray3 defines the following public operators:<br />

- (minus) Operator – The minus sign operator returns a ray with opposite direction.<br />

Point3 originPt = new Point3(5, 5, 5);<br />

Direction3 rayDi = new Direction3(3,3,3);<br />

Ray3 r = new Ray3(originPt, rayDi);<br />

Ray3 r1 = -r;<br />

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

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

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

Saved successfully!

Ooh no, something went wrong!