reb
Class Plane

Object
  extended by reb:Plane

class 
Object:Plane

class for creating plane objects


Ultra Fractal Source

Toggle UF Source Code Display

 class Plane {
 ; class for creating plane objects
 
 public:
 
 ; Plane constructor for Ax + By + C = 0
 ; @param A = A value
 ; @param B = B value
 ; @param C = C value
 ; @param D = D value
 func Plane(float A, float B, float C, float D)
     float norm = sqrt(A^2+B^2+C^2)
     pnx = A/norm
     pny = B/norm
     pnz = C/norm
     pspot = D/norm
     pa = A
     pb = B
     pc = C
     pd = D
   endfunc
 
 ; Is a point on the plane
   bool func OnPlane(float x, float y, float z, float tol)
     bool opl = false
       if (pa*x+pb*y+pc*z+pd < tol) && (pa*x+pb*y+pc*z+pd > -tol)
         opl = true
       endif
     return opl
   endfunc
 
   float pnx
   float pny
   float pnz
   float pspot
   float pa
   float pb
   float pc
   float pd
   
 default:
   title = "Plane"
   int param v_plane
     caption = "Version (Plane)"
     default = 100
     hint = "This version parameter is used to detect when a change has been made to the formula that is incompatible with the previous version. When that happens, this field will reflect the old version number to alert you to the fact that an alternate rendering is being used."
     visible = @v_plane < 100
   endparam
 
 }
 


Constructor Summary
Plane()
           
Plane(float A, float B, float C, float D)
          Plane constructor for Ax + By + C = 0
 
Method Summary
 boolean OnPlane(float x, float y, float z, float tol)
          Is a point on the plane
 
Methods inherited from class Object
 

Constructor Detail

Plane

public Plane(float A,
             float B,
             float C,
             float D)
Plane constructor for Ax + By + C = 0

Parameters:
A - = A value
B - = B value
C - = C value
D - = D value

Plane

public Plane()
Method Detail

OnPlane

public boolean OnPlane(float x,
                       float y,
                       float z,
                       float tol)
Is a point on the plane