Normal - package raytracer.utility; public class Normal...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
package raytracer.utility; public class Normal { public double x, y, z; // ---------------------------------------------------------- default constructor public Normal() { x = y = z = 0; } // ---------------------------------------------------------- constructor public Normal(double a) { x = y = z = a; } // ---------------------------------------------------------- constructor public Normal(double a, double b, double c) { x = a; y = b; z = c; } // ---------------------------------------------------------- copy constructor public Normal(Normal n) { x = n.x; y = n.y; z = n.z; } // ---------------------------------------------------------- constructor // construct a normal from a vector public Normal(Vector3D v) { x = v.x; y = v.y; z = v.z; } // ----------------------------------------------------------- operator= // assignment operator public void set (Normal rhs) { if (this != rhs) { x = rhs.x; y = rhs.y; z = rhs.z;
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
} } // ------------------------------------------------------------ operator= // assignment of a vector to a normal public void set (Vector3D rhs) {
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/19/2010 for the course CS 390 taught by Professor Hu during the Spring '10 term at Westminster UT.

Page1 / 4

Normal - package raytracer.utility; public class Normal...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online