Sphere - package raytracer.geometricObjects; import...

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

View Full Document Right Arrow Icon
package raytracer.geometricObjects; import raytracer.utility.*; public class Sphere extends GeometricObject { private Point3D center; // center coordinates as a point private double radius; // the radius private static final double kEpsilon = 0.001; // for shadows and secondary rays // ---------------------------------------------------------------- default constructor public Sphere() { super(); center = new Point3D(0.0); radius = 1.0; } // ---------------------------------------------------------------- constructor public Sphere(Point3D c, double r) { super(); center = new Point3D(c); radius = r; } // ---------------------------------------------------------------- copy constructor public Sphere (Sphere sphere) { super(sphere); center = new Point3D(sphere.center); radius = sphere.radius; } // ---------------------------------------------------------------- clone public Sphere clone() { return (new Sphere(this)); } // ---------------------------------------------------------------- assignment operator
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

Sphere - package raytracer.geometricObjects; import...

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

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