Unit Math_utils |
///////////////////////////////////////////////////////////////////////////// // Assorted routines // ŠJohn Biddiscombe // Rutherford Appleton Laboratory, UK // j.biddiscombe@rl.ac.uk // // /////////////////////////////////////////////////////////////////////////////
Classes |
Functions |
allocate_matrix -
allocate_points - ///////////////////////////////////////////////////////////////////////////// Memory /////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////// Memory /////////////////////////////////////////////////////////////////////////////
angle -
aPoint3D - ///////////////////////////////////////////////////////////////////////////// General point 3D stuff /////////////////////////////////////////////////////////////////////////////
BoolToStr -
CreateTransformation - Matrix order : For reference
start with a point at ( cos(30),sin(30),0 )
rotate by 30 degrees - shifts point to (1,0,0)
then translate by (10,0,0) shifts to (11,0,0)
then rotate by -45 degrees goes to (7.
cross -
deallocate_matrix -
deallocate_points -
dist2D -
dist3D -
dmax -
dmin -
dot - ///////////////////////////////////////////////////////////////////////////// Vector 3D stuff /////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////// Vector 3D stuff /////////////////////////////////////////////////////////////////////////////
float_out - ///////////////////////////////////////////////////////////////////////////// String /////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////// String /////////////////////////////////////////////////////////////////////////////
imax -
imin -
mag -
MatrixMultiply -
max_bound - ///////////////////////////////////////////////////////////////////////////// Bounds /////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////// Bounds /////////////////////////////////////////////////////////////////////////////
min_bound -
normalize -
p1_eq_p2_2D -
p1_eq_p2_3D -
p1_minus_p2 -
p1_plus_p2 -
p1_x_n -
Point3DToStr - result := FloatToStr(f);
powerxy - ///////////////////////////////////////////////////////////////////////////// Assorted /////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
ranbit - /////////////////////////////////////////////////////////////////////////////
RotationAxis -
ScaleMatrix -
setup_tables - ///////////////////////////////////////////////////////////////////////////// Lookup tables /////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////// Lookup tables /////////////////////////////////////////////////////////////////////////////
set_accuracy -
sq_dist2D -
sq_dist3D -
sq_mag3D -
TransformPoint -
TranslateMatrix -
update_transformations -
XRotateMatrix - ///////////////////////////////////////////////////////////////////////////// Rotations for Insert/Block drawing /////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////// Rotations for Insert/Block drawing /////////////////////////////////////////////////////////////////////////////
YRotateMatrix -
ZRotateMatrix -
Types |
coord
Matrix
pM
pMatrix
Point2D
Point3D
pointlist
pPoint3D
ppointlist
pTriangle
pTriangleList
table
Triangle
TriangleList
Constants |
cube
cube_edges
identity
origin3D
tablesize
tablesized2
tablesizep1
WCS_X
WCS_Y
WCS_Z
Variables |
cosine
lookups_done
sigmoids
sine
theta_d
Functions |
///////////////////////////////////////////////////////////////////////////// Memory /////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////// Vector 3D stuff /////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////// String /////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////// Bounds /////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////// Lookup tables /////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////// Rotations for Insert/Block drawing /////////////////////////////////////////////////////////////////////////////
Types |
coord = array[0..2] of double;
Matrix = record
val : array[0..3,0..3] of double;
end;
pM = pMatrix
pMatrix = ^Matrix
Point2D = record
x : Double;
y : Double;
end;
Point3D = record
x : double;
y : double;
z : double;
end;
pointlist = array[0..0] of Point3D;
pPoint3D = ^Point3D
ppointlist = ^pointlist
pTriangle = ^Triangle
pTriangleList = ^TriangleList
table = array[0..tablesize] of double;
Triangle = record
p1 : Point3D;
p2 : Point3D;
p3 : Point3D;
end;
TriangleList = array[0..0] of Triangle;
Constants |
Variables |