Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more.
Course Hero has millions of course specific materials providing students with the best way to expand
their education.
Below is a small sample set of documents:
Westminster UT - CS - 390
#ifndef _VIEW_PLANE_ # #define _VIEW_PLANE_ /- class ViewPlane class ViewPlane cfw_ public: int image resolution int resolution float size float correction factor float the gamma correction factor bool RGBColor out of gamuthres; vres; s; gamma; inv_gamma
Westminster UT - CS - 390
/ this file contains the definition of the World class # #include "wxraytracer.h" #include "World.h" # #include "Constants.h" / / geometric objects #include "Plane.h" # #include "Sphere.h" / / tracers #include "SingleSphere.h" # #include "MultipleObjects.
Westminster UT - CS - 390
#ifndef _WORLD_ # #define _WORLD_ / This file contains the declaration of the class World / The World class does not have a copy constructor or an assignment operator, for the followign reasons: / 1 There's no need to copy construct or assign the World /
Westminster UT - CS - 390
#ifndef _CONSTANTS_ # #define _CONSTANTS_ #include <stdlib.h> # #include "RGBColor.h" const const const const const double double double double double PI TWO_PI PI_ON_180 invPI invTWO_PI kEpsilon kHugeValue = 3.1415926535897932384; = 6.2831853071795864769
Westminster UT - CS - 390
#ifndef _MATHS_ # #define _MATHS_ inline double m max(double x0, double x1); inline double max(double x0, double x1) cfw_ return(x0 > x1) ? x0 : x1); #endif
Westminster UT - CS - 390
/ This file contains the definition of the class Matrix # #include "Matrix.h" / - default constructor / / a default matrix is an identity matrix M Matrix:Matrix(void) cfw_ for (int x = 0; x < 4; x+) for (int y = 0; y < 4; y+) cfw_ if (x = y) m[x][y] = 1.0
Westminster UT - CS - 390
#ifndef _MATRIX_ # #define _MATRIX_ / this file contains the declaration of the class Matrix / Matrix is a 4 x 4 square matrix that is used to represent affine transformations / / we don't need a general m x n matrix / /- class Matrix c class Matrix cfw_
Westminster UT - CS - 390
/ This file contains the defintion of the class Normal # #include <math.h> # #include "Normal.h" / / - default constructor Normal:Normal(void) : x(0.0), y(0.0), z(0.0) cfw_ / / - constructor Normal:Normal(double a) : x(a), y(a), z(a) cfw_ / / - constructo
Westminster UT - CS - 390
#ifndef _NORMAL_ # #define _NORMAL_ / / This file contains the declaration of the class Normal #include "Matrix.h" #include "Vector3D.h" # #include "Point3D.h" class Normal cfw_ p public: double p public: Normal(void); / default constructor Normal(double
Westminster UT - CS - 390
/ this file contains the definition of the class Point3D #include <math.h> # #include "Point3D.h" / / - default constructor Point3D:Point3D() :x(0), y(0), z(0) cfw_ cfw_ / / - constructor Point3D:Point3D(const double a) :x(a), y(a), z(a) cfw_ cfw_ / / - c
Westminster UT - CS - 390
#ifndef _POINT3D_ # #define _POINT3D_ / / This file contains the defintion of the class Point3D #include "Matrix.h" # #include "Vector3D.h" class Point3D cfw_ p public: d double x, y, z; Point3D(); / default constructor Point3D(const double a); / construc
Westminster UT - CS - 390
#include "Ray.h" / - default constructor Ray:Ray (void) : o(0.0), d(0.0, 0.0, 1.0) cfw_ / / - constructor Ray:Ray (const Point3D& origin, const Vector3D& dir) : o(origin), d(dir) cfw_ / - copy constructor Ray:Ray (const Ray& ray) : o(ray.o), d(ray.d) cfw_
Westminster UT - CS - 390
#ifndef _RAY_ # #define _RAY_ #include "Point3D.h" # #include "Vector3D.h" class Ray cfw_ p public: Point3D Vector3D R Ray(void); R Ray(const Point3D& origin, const Vector3D& dir); R Ray(const Ray& ray); R Ray& operator= (const Ray& rhs); ~Ray(void); ; #
Westminster UT - CS - 390
/ This file contains the definition of the class RGBColor # #include <math.h> # #include "RGBColor.h" / / - default constructor RGBColor:RGBColor(void) : r(0.0), g(0.0), b(0.0) cfw_ cfw_ / / - constructor RGBColor:RGBColor(float c) : r(c), g(c), b(c) cfw_
Westminster UT - CS - 390
#ifndef _RGB_COLOR_ # #define _RGB_COLOR_ / / This file contains the declaration of the class RGBColor / /- class RGBColor c class RGBColor cfw_ p public: float r, g, b; r p public: RGBColor(void); / default constructor RGBColor(float c); / constructor RG
Westminster UT - CS - 390
/ this file contains the definition of the class ShadeRec / there is no default constructor as the World reference always has to be initialised / there is also no assignment operator as we don't want to assign the world / the copy constructor only copies
Westminster UT - CS - 390
#ifndef _SHADE_REC_ # #define _SHADE_REC_ / / this file contains the declaration of the class ShadeRec class World; is a reference / only need a forward class declaration as the World data member#include "Point3D.h" #include "Normal.h" # #include "RGBCol
Westminster UT - CS - 390
/ This file contains the definition of the class Vector3D # #include <math.h> #include "Vector3D.h" #include "Normal.h" # #include "Point3D.h" / / - default constructor Vector3D:Vector3D(void) : x(0.0), y(0.0), z(0.0) cfw_ / / - constructor Vector3D:Vecto
Westminster UT - CS - 390
#ifndef _VECTOR_3D_ # #define _VECTOR_3D_ / / This file contains the defintion of the class Vector3D # #include "Matrix.h" class Normal; c class Point3D; / /- class Vector3D class Vector3D cfw_ p public: double p public: Vector3D(void); / default construc
Westminster UT - CS - 390
Westminster UT - CS - 390
Westminster UT - CS - 390
#include #include #include #include # #include<wx/wx.h> <wx/dcbuffer.h> "wxraytracer.h" "main.xpm" "bg.xpm"/*/ /* wxraytracerapp */ / /*/ BEGIN_EVENT_TABLE(wxraytracerapp, wxApp) E END_EVENT_TABLE() I IMPLEMENT_APP(wxraytracerapp) bool wxraytracerapp:On
Westminster UT - CS - 390
#ifndef _WXRAYTRACER_H_ # #define _WXRAYTRACER_H_ /* * Ray Tracer skeleton * * Author : Sverre Kvaale <sverre@kvaale.com> * Version: 0.8 * */ #include <wx/wx.h> #include "World.h" # #include <vector> u using namespace std; class class class c class wxrayt
Westminster UT - CS - 390
#include "MultipleObjects.h" # #include "World.h" / - default constructor MultipleObjects:MultipleObjects(void) : Tracer() cfw_ cfw_ / / - constructor MultipleObjects:MultipleObjects(World* _worldPtr) : Tracer(_worldPtr) cfw_ cfw_ / / - destructor M Multi
Westminster UT - CS - 390
#ifndef _MULTIPLE_OBJECTS_ # #define _MULTIPLE_OBJECTS_ # #include "Tracer.h" class MultipleObjects: public Tracer cfw_ p public: M MultipleObjects(void); M MultipleObjects(World* _world_ptr); v virtual ~ ~MultipleObjects(void); v virtual RGBColor trace_r
Westminster UT - CS - 390
#include "SingleSphere.h" #include "World.h" # #include "ShadeRec.h" / - default constructor SingleSphere:SingleSphere(void) : Tracer() cfw_ cfw_ / / - constructor SingleSphere:SingleSphere(World* _worldPtr) : Tracer(_worldPtr) cfw_ cfw_ / / - destructor
Westminster UT - CS - 390
#ifndef _SINGLE_SPHERE_ # #define _SINGLE_SPHERE_ # #include "Tracer.h" class SingleSphere: public Tracer cfw_ p public: S SingleSphere(void); S SingleSphere(World* _worldPtr); v virtual ~ ~SingleSphere(void); v virtual RGBColor trace_ray(const Ray& ray)
Westminster UT - CS - 390
#include "Tracer.h" / - default constructor Tracer:Tracer(void) : world_ptr(NULL) cfw_ cfw_ / / - constructor Tracer:Tracer(World* _worldPtr) : world_ptr(_worldPtr) cfw_ cfw_/ / - destructor Tracer:~Tracer(void) cfw_ if (world_ptr) world_ptr = NULL; / /
Westminster UT - CS - 390
/ This is the declaration of the base class Tracer / The tracer classes have no copy constructor, assignment operator. or clone function because / of the world pointer, which should not be assigned or copy constructed / / See comments in the World.h file.
Westminster UT - CS - 390
/ this file contains the definition of the class GeometricObject #include "Constants.h" # #include "GeometricObject.h" / - default constructor GeometricObject:GeometricObject(void) : color(black) cfw_ cfw_ / - copy constructor GeometricObject:GeometricObj
Westminster UT - CS - 390
#ifndef _GEOMETRIC_OBJECT_ # #define _GEOMETRIC_OBJECT_ / / this file contains the declaration of the class GeometricObject #include #include #include #include # #include "RGBColor.h" "Point3D.h" "Normal.h" "Ray.h" "ShadeRec.h"# #include "Constants.h" c
Westminster UT - CS - 390
#include "Plane.h" c const double Plane:kEpsilon = 0.001; / -constructor P Plane:Plane(void) : GeometricObject(), a(0.0), n n(0, 1, 0) cfw_ cfw_ / -constructor Plane:Plane(const Point3D& point, const Normal& normal) : GeometricObject(), a(point), n(normal
Westminster UT - CS - 390
#ifndef _PLANE_ # #define _PLANE_ # #include "GeometricObject.h" / /- class Plane c class Plane: public GeometricObject cfw_ p public: Plane(void); / default constructor constructor Plane(const Point3D& point, const Normal& normal); /Plane(const Plane& p
Westminster UT - CS - 390
/ This file contains the definition of the class sphere #include "Sphere.h" # #include "math.h" c const double Sphere:kEpsilon = 0.001; / - default constructor S Sphere:Sphere(void) : GeometricObject(), center(0.0), radius(1.0) cfw_ cfw_ / / - constructor
Westminster UT - CS - 390
#ifndef _SPHERE_ # #define _SPHERE_ / / This file contains the declaration of the class Sphere # #include "GeometricObject.h" /-class Sphere c class Sphere: public GeometricObject cfw_ public: Sphere(void); Default constructor Sphere(Point3D center, doubl
Westminster UT - CS - 390
/ This builds the cover image for Chapter 3: Bare Bones Ray Tracing v void World:build(void) cfw_ vp.set_hres(400); vp.set_vres(400); v vp.set_pixel_size(0.5); background_color = RGBColor(0.0); t tracer_ptr = new MultipleObjects(this); / / colours RGBColo
Westminster UT - CS - 390
void World:build(void) cfw_ vp.set_hres(200); vp.set_vres(200); v vp.set_pixel_size(1.0); t tracer_ptr = new MultipleObjects(this); b background_color = RGBColor(black); / / use access functions to set centre and radius Sphere* sphere_ptr = new Sphere; sp
Westminster UT - CS - 390
void World:build(void) cfw_ vp.set_hres(200); vp.set_vres(200); vp.set_pixel_size(1.0); v vp.set_gamma(1.0); background_color = white; t tracer_ptr = new SingleSphere(this); sphere.set_center(0.0); sphere.set_radius(85);
Westminster UT - MATH - 1240
4100 AWL/Thomas_ch05p325-395 8/20/04 9:58 AM Page 395Chapter 5Technology Application Projects395Chapter 5Technology Application ProjectsMathematica/Maple ModuleUsing Riemann Sums to Estimate Areas, Volumes, and Lengths of Curves Visualize and appro
Westminster UT - MATH - 1240
4100 AWL/Thomas_ch14p965-1066 8/25/04 2:53 PM Page 984984Chapter 14: Partial Derivatives14.3Partial DerivativesThe calculus of several variables is basically single-variable calculus applied to several variables one at a time. When we hold all but on
University of Texas - GOV - 38655
American Government Test 1 Review Federalist Papers - supported the ratification of the US constitution. - #10 - by James Madison - addresses how to guard against factions with interests opposite of the rights of others or the interest of the whole commun
University of Phoenix - ACC 220 - 90
Internal Cash Control1Week 4 Assignment Internal Cash Control Denise Keith ACC / 220 February 14, 2010 Teri MooreInternal Cash Control2Many companies have issues with their cash handling procedures. They do not know how to track where their cash is g
University of Phoenix - COM 220 - AAGI0H3E26
Annotated Bibliography Battersby, S. (2009). Is Pluto a planet after all? New Scientist Magazine. Retrieved January 29, 2010. from: www.newscientist./com/aricle/mg20327 181.600-is-pluto-a-planet-after-all.html This article offers hope to the many fans of
Punjab Engineering College - ECONOMICS - 009031
There Is No Such Thing as Too Much Productivity An editor e-mailed the other day with one of those questions that editors ask to drive reporters crazy. "Isn't it possible," he wondered, "to have too much productivity growth?" Sure, I said to myself, and i
DeVry Austin - MATH - math 221
Final Exam Review Questions You should work each of the following on your own, then review the solutions guide. DO NOT look at the solutions guide first. 1. Explain the difference between a population and a sample. In which of these is it important to dis
Texas San Antonio - GOV - -
ThirdPlanet17:00I.GeologyandHumanAffairs A. Materialgoods B. Geologicdisasters C. Wherewelive D. Worldhistory E. Philosophy II.TheBirthofModernGeology(Pre18thCentury) A. Q.Whatistheageoftheeart? o A.Severalthousandyears. B. ArchbishopUssher(15811656) o
Texas San Antonio - GOV - -
Review Characteristics of the 1920s as a conservative eraProblems with prohibition Scopes trial Monkey Trial, 1925, Dayton, Tennessee John Scopes was defended by Clarence Darrow Attracted national attention Biblical Literalism vs. more scientific interpr
Texas San Antonio - GOV - -
Civil War to Present Final Review1960s Freedom Movements: - Sit-Ins at restaurants by blacks to be served in Nashville. - On May 10th sit-ins prove successful, black customers were served at 6 downtown stores. - Student Nonviolent Coordinating Committee
Texas San Antonio - GOV - -
Civil War Present ReviewRECONSTRUCTION Goals of African Americans: -Receive civil rights. Andrew Johnson: - Supported the Presidential Theory - Most southern whites would be pardoned. - Southern states could establish governments. - Southern states must
University of Texas - GOV 310L - 0000000
American Government Test 1 Review Federalist Papers - supported the ratification of the US constitution. - #10 - by James Madison - addresses how to guard against factions with interests opposite of the rights of others or the interest of the whole commun
Abraham Baldwin Agricultural College - EE - 142
#ifndef _LIB_CTYPE_H #define _LIB_CTYPE_H static inline int islower (int c) cfw_ return c >= 'a' & c <= 'z'; static inline int isupper (int c) cfw_ return c >= 'A' & c <= 'Z'; static inline int isalpha (int c) cfw_ return islower (c) | isupper (c); sta
Abraham Baldwin Agricultural College - EE - 142
#ifndef _LIB_DEBUG_H #define _LIB_DEBUG_H /* GCC lets us add "attributes" to functions, function parameters, etc. to indicate their properties. See the GCC manual for details. */ #define UNUSED _attribute_ (unused) #define NO_RETURN _attribute_ (noreturn)
Abraham Baldwin Agricultural College - EE - 142
#ifndef _LIB_INTTYPES_H #define _LIB_INTTYPES_H #include <stdint.h> #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #de
Abraham Baldwin Agricultural College - EE - 142
#ifndef _LIB_LIMITS_H #define _LIB_LIMITS_H #define CHAR_BIT 8 #define SCHAR_MAX 127 #define SCHAR_MIN (-SCHAR_MAX - 1) #define UCHAR_MAX 255 #ifdef _CHAR_UNSIGNED_ #define CHAR_MIN 0 #define CHAR_MAX UCHAR_MAX #else #define CHAR_MIN SCHAR_MIN #define CHA
Abraham Baldwin Agricultural College - EE - 142
#ifndef _LIB_PACKED_H #define _LIB_PACKED_H /* The "packed" attribute, when applied to a structure, prevents GCC from inserting padding bytes between or after structure members. It must be specified at the time of the structure's definition, normally just
Abraham Baldwin Agricultural College - EE - 142
#ifndef _LIB_RANDOM_H #define _LIB_RANDOM_H #include <stddef.h> void random_init (unsigned seed); void random_bytes (void *, size_t); unsigned long random_ulong (void); #endif /* lib/random.h */
Abraham Baldwin Agricultural College - EE - 142
#ifndef _LIB_ROUND_H #define _LIB_ROUND_H /* Yields X rounded up to the nearest multiple of STEP. For X >= 0, STEP >= 1 only. */ #define ROUND_UP(X, STEP) (X) + (STEP) - 1) / (STEP) * (STEP) /* Yields X divided by STEP, rounded up. For X >= 0, STEP >= 1 o
Abraham Baldwin Agricultural College - EE - 142
#ifndef _LIB_STDARG_H #define _LIB_STDARG_H /* GCC has <stdarg.h> functionality as built-ins, so all we need is to use it. */ typedef _builtin_va_list va_list; #define #define #define #define va_start(LIST, ARG) va_end(LIST) va_arg(LIST, TYPE) va_copy(DST
Abraham Baldwin Agricultural College - EE - 142
#ifndef _LIB_STDBOOL_H #define _LIB_STDBOOL_H #define #define #define #define bool _Bool true 1 false 0 _bool_true_false_are_defined1#endif /* lib/stdbool.h */
Abraham Baldwin Agricultural College - EE - 142
#ifndef _LIB_STDDEF_H #define _LIB_STDDEF_H #define NULL (void *) 0) #define offsetof(TYPE, MEMBER) (size_t) &(TYPE *) 0)->MEMBER) /* GCC predefines the types we need for ptrdiff_t and size_t, so that we don't have to guess. */ typedef _PTRDIFF_TYPE_ ptrd
Abraham Baldwin Agricultural College - EE - 142
#ifndef _LIB_STDINT_H #define _LIB_STDINT_H typedef signed char int8_t; #define INT8_MAX 127 #define INT8_MIN (-INT8_MAX - 1) typedef signed short int int16_t; #define INT16_MAX 32767 #define INT16_MIN (-INT16_MAX - 1) typedef signed int int32_t; #define