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 rays for inequality.<br />

Two instances are equal if their origins are the same and their directions are the same.<br />

Note that comparing Ray3.Null to any other instance will return false. This is to<br />

maintain consistency with the behavior of floating point NaN comparison.<br />

bool result = (r1 != r);<br />

//result is true<br />

+ Operator - This operation returns the same 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 />

Ray3 r1 = +r;<br />

== Operator - This operation compares two instances for equality.<br />

bool result = (r1 == r);<br />

//result is true<br />

Ray3 class defines the following public methods:<br />

Equals - This method compares this instance with another object for equality. Returns<br />

true if this instance is equal to the other object.<br />

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

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

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

Ray3 r2 = +r1;<br />

bool result = r1.Equals(r2);<br />

//result is true<br />

GetHashCode - This method gets the hash code for this instance.<br />

IsNull - This method determines if the given instance has a Null definition.<br />

Ray3 r1 = Ray3.Null;<br />

//create a null Ray<br />

bool result = Ray3.IsNull(r1);<br />

//result is true<br />

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