/*********************************************************************************************
 *                                                                                           *
 *                                                                                           *
 *   Copyright 1989-2018 by AutoDesSys, Inc.                                                 *
 *                                                                                           *
 *   This software and its associated documentation contains proprietary,                    *
 *   confidential, and trade secret information of AutoDesSys Inc. and may not be            *
 *   disclosed, copied in any form, or used for any purpose except as specifically           *
 *   permitted in writing by AutoDesSys, Inc.                                                *
 *                                                                                           *
 *   AutoDesSys, Inc. grants permission to use the software to those who purchase            *
 *   a license.  Such a usage will be made according to the terms and conditions             *
 *   specified in the license agreement to which a licensee agrees before installing         *
 *   and commencing usage of the software.  The license agreement can be found               *
 *   on the envelop that contains the software CD.                                           *
 *                                                                                           *
 *   AutoDesSys, Inc. also grants permission to licensees to develop extensions to           *
 *   the software, which can be in the form of scripts or plugins.  The permission           *
 *   includes calling the API and call back functions provided by AutoDesSys, Inc.           *
 *   and accessing information relevant to these functions and the general workings          *
 *   of form.Z, but only up to the point to which AutoDesSys, Inc. has chosen to             *
 *   expose, through its form.Z SDK Manual.  All extensions developed by third               *
 *   parties will include a copy of this copyright note in an easily accessible place or     *
 *   a clear instruction to read this original note by AutoDesSys, Inc.                      *
 *                                                                                           *
 *   All the software distributed under a license, either for the purpose of using it or     *
 *   for the purpose of developing extensions, is distributed AS IS, WITHOUT                 *
 *   WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, AND                                    *
 *   AutoDesSys, Inc. HEREBY DISCLAIMS ALL SUCH WARRANTIES,                                  *
 *   INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF                                         *
 *   MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.                                    *
 *                                                                                           *
 *   formZ, RenderZone, and RadioZity are registered trademarks of AutoDesSys, Inc.          *
 *                                                                                           *
 *   form.Z SDK, Version 8.6.3, Dec 03, 2018                                                 *
 *                                                                                           *
 *                                                                                           *
 *********************************************************************************************/



#ifndef __FORMZ_MATH_API_H
#define __FORMZ_MATH_API_H 1

#include "fzpl_plugin.h"

#include "fz_type_api.h"

#ifdef __cplusplus
extern "C" {
#endif





/****************************************************************

	FZ_PI


	Description
		Accurate (20 decimal place) definition of PI

	Availability	5.0.0.0

 ****************************************************************/
	#define	FZ_PI			(3.14159265358979323846)

/****************************************************************

	FZ_2PI


	Description
		Accurate (20 decimal place) definition of 2*PI

	Availability	5.0.0.0

 ****************************************************************/
	#define	FZ_2PI		(6.28318530717958647692)

/****************************************************************

	FZ_PI2


	Description
		Accurate (20 decimal place) definition of PI/2

	Availability	5.0.0.0

 ****************************************************************/
	#define	FZ_PI2		(1.57079632679489661923)

/****************************************************************

	FZ_PI4


	Description
		Accurate (20 decimal place) definition of PI/4

	Availability	5.0.0.0

 ****************************************************************/
	#define	FZ_PI4		(0.78539816339744830966)

/****************************************************************

	FZ_RADIAN


	Description
		Accurate definition of a radian (PI/180.0)

	Availability	5.0.0.0

 ****************************************************************/
	#define	FZ_RADIAN		(FZ_PI/180.0)

/****************************************************************

	FZ_E


	Description
		Accurate (20 decimal place) definition of E

	Availability	5.0.0.0

 ****************************************************************/
	#define	FZ_E		(2.71828182845904523536)

/****************************************************************

	FZ_METRIC_FACTOR


	Description
		Accurate (8 decimal place) definition of # of CM in an inch

	Availability	5.0.0.0

 ****************************************************************/
	#define	FZ_METRIC_FACTOR		(2.54000508)

/****************************************************************

	FZ_METRIC_FACTOR_SQ


	Description
		Accurate (8 decimal place) definition of # of square CM in an square inch

	Availability	5.0.0.0

 ****************************************************************/
	#define	FZ_METRIC_FACTOR_SQ		(6.451625806)

/****************************************************************

	FZ_METRIC_FACTOR_CU


	Description
		Accurate (8 decimal place) definition of # of square CM in an square inch

	Availability	5.0.0.0

 ****************************************************************/
	#define	FZ_METRIC_FACTOR_CU		(16.38716232)

/****************************************************************

	fz_axis_enum


	Description
		Identifier of an axis.

	Members
		FZ_AXIS_NONE
			Axis : NONE
		FZ_AXIS_X
			Axis : X Axis
		FZ_AXIS_Y
			Axis : Y Axis
		FZ_AXIS_Z
			Axis : Z Axis

	Availability	5.0.0.0


	See Also
		fz_math_3d_rot_pt_around_axis,fz_math_3x3_set_refl_mat, 
		fz_math_4x4_set_rot_mat,fz_math_4x4_set_rot_cntr_mat

 ****************************************************************/
typedef enum fz_axis_enum
{
	FZ_AXIS_NONE = -1,
	FZ_AXIS_X = 0,
	FZ_AXIS_Y,
	FZ_AXIS_Z
	
} fz_axis_enum;

/****************************************************************

	fz_plane_enum


	Description
		Identifier of an axis plane.

	Members
		FZ_PLANE_XY
			Axis Plane : XY Plane
		FZ_PLANE_YZ
			Axis Plane : YZ Plane
		FZ_PLANE_ZX
			Axis Plane : ZX Plane

	Availability	5.0.0.0


	See Also
		fz_math_3d_dir_of_3_pts,fz_math_3d_get_proj_plane, 
		fz_math_3d_pt_in_proj_plane,fz_math_4x4_set_refl_mat

 ****************************************************************/
typedef enum fz_plane_enum
{
	FZ_PLANE_XY = 1,
	FZ_PLANE_YZ,
	FZ_PLANE_ZX
	
} fz_plane_enum;

/****************************************************************

	FZ_MATH_TOL_SCL_ZERO


	Description
		Scale tolerance. Tolerance used to determine if a scale factor is zero.

	Availability	5.0.0.0

 ****************************************************************/
#define	FZ_MATH_TOL_SCL_ZERO	1.0e-9

/****************************************************************

	FZ_MATH_TOL_LIN


	Description
		Linear tolerance. Tolerance used to determine if two points are the same.

	Availability	5.0.0.0

 ****************************************************************/
#define	FZ_MATH_TOL_LIN		1.0e-6

/****************************************************************

	FZ_MATH_TOL_LIN_SQUARED


	Description
		Square tolerance. Tolerance used to determine if the square of two points are the same.

	Availability	5.0.0.0

 ****************************************************************/
#define	FZ_MATH_TOL_LIN_SQUARED	1.0e-12

/****************************************************************

	FZ_MATH_TOL_ANG_ZERO


	Description
		Angular tolerance. Tolerance used to determine if an angle is zero.

	Availability	5.0.0.0

 ****************************************************************/
#define	FZ_MATH_TOL_ANG_ZERO		0.000174533

/****************************************************************

	FZ_MATH_TOL_HORIZ_SLOPE


	Description
		Horizontal line tolerance. Tolerance used to determine if a line is horizontal. 
		If dy/dx is less than FZ_MATH_TOL_HORIZ_SLOPE, the line is horizontal.

	Availability	5.0.0.0

 ****************************************************************/
#define	FZ_MATH_TOL_HORIZ_SLOPE		1.0e-7

/****************************************************************

	FZ_MATH_TOL_VERT_SLOPE


	Description
		Vertical line tolerance. Tolerance used to determine if a line is vertical. 
		If dy/dx is less than FZ_MATH_TOL_VERT_SLOPE, the line is horizontal.

	Availability	5.0.0.0

 ****************************************************************/
#define	FZ_MATH_TOL_VERT_SLOPE			1.0e6


/****************************************************************

	FZ_MATH_VALS_EQUAL


	Description
		Checks whether two values are the same (within a tolerance).

	Parameters
		double _val1  [Input]
			value 1.
		double _val2  [Input]
			value 2.

	Returns
		TRUE if equal, FALSE otherwise



	Availability	5.0.0.0


	See Also
		FZ_MATH_VAL_BETWEEN,FZ_MATH_VAL_EQUAL_BETWEEN

 ****************************************************************/
#define FZ_MATH_VALS_EQUAL(_val1,_val2) ((fabs((_val1) - (_val2)) < FZ_MATH_TOL_LIN) ? TRUE : FALSE)

/****************************************************************

	FZ_MATH_VAL_BETWEEN


	Description
		Checks whether a value is between two given values.

	Parameters
		double _val1  [Input]
			value 1.
		double _val2  [Input]
			value 2.
		double _check_val  [Input]
			value to check if it's between the other values.

	Returns
		TRUE if between, FALSE otherwise



	Availability	5.0.0.0


	See Also
		FZ_MATH_VALS_EQUAL,FZ_MATH_VAL_EQUAL_BETWEEN

 ****************************************************************/
#define FZ_MATH_VAL_BETWEEN(_val1,_val2,_check_val) ((((_check_val) < (_val1) && (_check_val) < (_val2)) ||				\
													((_check_val) > (_val1) && (_check_val) > (_val2))) ? FALSE : TRUE)

/****************************************************************

	FZ_MATH_VAL_EQUAL_BETWEEN


	Description
		Checks whether a value is between two given values or 
		equal to either value.

	Parameters
		double _val1  [Input]
			value 1.
		double _val2  [Input]
			value 2.
		double _check_val  [Input]
			value to check if it's between or equal to the other values.

	Returns
		TRUE if between or equal, FALSE otherwise



	Availability	5.0.0.0


	See Also
		FZ_MATH_VALS_EQUAL,FZ_MATH_VAL_BETWEEN

 ****************************************************************/
#define FZ_MATH_VAL_EQUAL_BETWEEN(_val1,_val2,_check_val) ((FZ_MATH_VALS_EQUAL(_val1,_check_val) ||		\
														FZ_MATH_VALS_EQUAL(_val2,_check_val) ||		\
														FZ_MATH_VAL_BETWEEN(_val1,_val2,_check_val)) ? TRUE : FALSE)

/****************************************************************

	FZ_MATH_ATAN2


	Description
		Computes the arc tangent of y / x. 
		Allows x to be 0 (i.e. 90 or - 90 degrees).

	Parameters
		double _x  [Input]
			y value end point of line.
		double _y  [Input]
			x value end point of line.

	Returns
		arc	tangent (i.e. the angle of the line starting at (0.0, 0.0) and ending at (_x, _y))



	Availability	5.0.0.0

 ****************************************************************/
#define	FZ_MATH_ATAN2(_y,_x) ((fabs(_x) < FZ_MATH_TOL_HORIZ_SLOPE) ? ((_y) > 0.0 ? FZ_PI2 : -FZ_PI2) : atan2((_y),(_x)))

/****************************************************************

	FZ_MATH_DEG_2_RAD


	Description
		Converts degrees to radians.

	Parameters
		double _deg  [Input]
			angle in degrees.

	Returns
		angle in radians



	Availability	5.0.0.0


	See Also
		FZ_MATH_RAD_2_DEG

 ****************************************************************/
#define	FZ_MATH_DEG_2_RAD(_deg) (((_deg) / 180.0) * FZ_PI)

/****************************************************************

	FZ_MATH_RAD_2_DEG


	Description
		Converts radians to degrees.

	Parameters
		double _rad  [Input]
			angle in radians.

	Returns
		angle in degrees



	Availability	5.0.0.0


	See Also
		FZ_MATH_DEG_2_RAD

 ****************************************************************/
#define	FZ_MATH_RAD_2_DEG(_rad) (((_rad) / FZ_PI) * 180.0)


/****************************************************************

	FZ_MATH_2D_VEC_LEN_SQUARED


	Description
		Computes the squared length of a 2d vector.

	Parameters
		fz_xy_td * vec  [Input]
			2d vector.

	Returns
		squared 2d vector length



	Availability	5.0.0.0


	See Also
		FZ_MATH_2D_DIST_PT_PT_SQUARED,FZ_MATH_2D_PT_PT_DIST, 
		FZ_MATH_2D_IS_EQUAL_PTS,FZ_MATH_2D_DOT_PROD,FZ_MATH_2D_CREATE_VEC,FZ_MATH_2D_SCALE_XY, 
		FZ_MATH_2D_ADD_XY,FZ_MATH_2D_MID_PT,FZ_MATH_2D_INTERP_X,FZ_MATH_2D_INTERP_Y, 
		FZ_MATH_2D_PT_SIDE_OF_LINE,FZ_MATH_2D_AREA_OF_3_PTS

 ****************************************************************/
#define FZ_MATH_2D_VEC_LEN_SQUARED(_vec)	((_vec)->x * (_vec)->x + (_vec)->y * (_vec)->y)

/****************************************************************

	FZ_MATH_2D_DIST_PT_PT_SQUARED


	Description
		Computes the squared distance between two 2d points.

	Parameters
		fz_xy_td * _p1  [Input]
			2d point 1.
		fz_xy_td * _p2  [Input]
			2d point 2.

	Returns
		squared distance between the two 2d points



	Availability	5.0.0.0


	See Also
		FZ_MATH_2D_VEC_LEN_SQUARED,FZ_MATH_2D_PT_PT_DIST, 
		FZ_MATH_2D_IS_EQUAL_PTS,FZ_MATH_2D_DOT_PROD,FZ_MATH_2D_CREATE_VEC,FZ_MATH_2D_SCALE_XY, 
		FZ_MATH_2D_ADD_XY,FZ_MATH_2D_MID_PT,FZ_MATH_2D_INTERP_X,FZ_MATH_2D_INTERP_Y, 
		FZ_MATH_2D_PT_SIDE_OF_LINE,FZ_MATH_2D_AREA_OF_3_PTS

 ****************************************************************/
#define FZ_MATH_2D_DIST_PT_PT_SQUARED(_p1,_p2)	( 	((_p2)->x - (_p1)->x) * ((_p2)->x - (_p1)->x) + \
												((_p2)->y - (_p1)->y) * ((_p2)->y - (_p1)->y) )

/****************************************************************

	FZ_MATH_2D_PT_PT_DIST


	Description
		Computes the distance between two 2d points.

	Parameters
		fz_xy_td * _p1  [Input]
			2d point 1.
		fz_xy_td * _p2  [Input]
			2d point 2.

	Returns
		distance between the two 2d points



	Availability	5.0.0.0


	See Also
		FZ_MATH_2D_VEC_LEN_SQUARED,FZ_MATH_2D_DIST_PT_PT_SQUARED, 
		FZ_MATH_2D_IS_EQUAL_PTS,FZ_MATH_2D_DOT_PROD,FZ_MATH_2D_CREATE_VEC,FZ_MATH_2D_SCALE_XY, 
		FZ_MATH_2D_ADD_XY,FZ_MATH_2D_MID_PT,FZ_MATH_2D_INTERP_X,FZ_MATH_2D_INTERP_Y, 
		FZ_MATH_2D_PT_SIDE_OF_LINE,FZ_MATH_2D_AREA_OF_3_PTS

 ****************************************************************/
#define FZ_MATH_2D_PT_PT_DIST(_p1,_p2)	(sqrt(FZ_MATH_2D_DIST_PT_PT_SQUARED(_p1,_p2)))

/****************************************************************

	FZ_MATH_2D_IS_EQUAL_PTS


	Description
		Checks whether two 2d points are equal (within a tolerance).

	Parameters
		fz_xy_td * _p1  [Input]
			2d point 1.
		fz_xy_td * _p2  [Input]
			2d point 2.

	Returns
		TRUE if equal, FALSE otherwise



	Availability	5.0.0.0


	See Also
		FZ_MATH_2D_VEC_LEN_SQUARED,FZ_MATH_2D_DIST_PT_PT_SQUARED,FZ_MATH_2D_PT_PT_DIST, 
		FZ_MATH_2D_DOT_PROD,FZ_MATH_2D_CREATE_VEC,FZ_MATH_2D_SCALE_XY, 
		FZ_MATH_2D_ADD_XY,FZ_MATH_2D_MID_PT,FZ_MATH_2D_INTERP_X,FZ_MATH_2D_INTERP_Y, 
		FZ_MATH_2D_PT_SIDE_OF_LINE,FZ_MATH_2D_AREA_OF_3_PTS

 ****************************************************************/
#define FZ_MATH_2D_IS_EQUAL_PTS(_p1,_p2) ((FZ_MATH_2D_DIST_PT_PT_SQUARED(_p1,_p2) < FZ_MATH_TOL_LIN_SQUARED) ? TRUE : FALSE)


/****************************************************************

	FZ_MATH_2D_DOT_PROD


	Description
		Computes the dot product of two 2d vectors.

	Parameters
		fz_xy_td * _p1  [Input]
			2d vector 1.
		fz_xy_td * _p2  [Input]
			2d vector 2.

	Returns
		dot product of the two 2d vectors



	Availability	5.0.0.0


	See Also
		FZ_MATH_2D_VEC_LEN_SQUARED,FZ_MATH_2D_DIST_PT_PT_SQUARED,FZ_MATH_2D_PT_PT_DIST, 
		FZ_MATH_2D_IS_EQUAL_PTS,FZ_MATH_2D_CREATE_VEC,FZ_MATH_2D_SCALE_XY, 
		FZ_MATH_2D_ADD_XY,FZ_MATH_2D_MID_PT,FZ_MATH_2D_INTERP_X,FZ_MATH_2D_INTERP_Y, 
		FZ_MATH_2D_PT_SIDE_OF_LINE,FZ_MATH_2D_AREA_OF_3_PTS

 ****************************************************************/
#define FZ_MATH_2D_DOT_PROD(_vec1,_vec2)	( (_vec1)->x * (_vec2)->x + (_vec1)->y * (_vec2)->y )

/****************************************************************

	FZ_MATH_2D_CREATE_VEC


	Description
		Creates a 2d vector from two 2d points. 
		From point 1(_p1) to point 2(_p2).

	Parameters
		fz_xy_td * _p1  [Input]
			2d point 1.
		fz_xy_td * _p2  [Input]
			2d point 2.
		fz_xy_td * _vec  [Result]
			2d vector.

	Returns
		none


	Availability	5.0.0.0


	See Also
		FZ_MATH_2D_VEC_LEN_SQUARED,FZ_MATH_2D_DIST_PT_PT_SQUARED,FZ_MATH_2D_PT_PT_DIST, 
		FZ_MATH_2D_IS_EQUAL_PTS,FZ_MATH_2D_DOT_PROD,FZ_MATH_2D_SCALE_XY, 
		FZ_MATH_2D_ADD_XY,FZ_MATH_2D_MID_PT,FZ_MATH_2D_INTERP_X,FZ_MATH_2D_INTERP_Y, 
		FZ_MATH_2D_PT_SIDE_OF_LINE,FZ_MATH_2D_AREA_OF_3_PTS

 ****************************************************************/
#define FZ_MATH_2D_CREATE_VEC(_p1,_p2,_vec)		\
	do	{	(_vec)->x = (_p2)->x - (_p1)->x; 	\
			(_vec)->y = (_p2)->y - (_p1)->y; 	\
		} while (0)
		
/****************************************************************

	FZ_MATH_2D_SCALE_XY


	Description
		Scales an xy by a factor.

	Parameters
		fz_xy_td * _xy_in  [Input]
			xy to be scaled.
		double * _scale  [Input]
			scale factor.
		fz_xy_td * _xy_out  [Result]
			scaled xy.

	Returns
		none


	Availability	5.0.0.0


	See Also
		FZ_MATH_2D_VEC_LEN_SQUARED,FZ_MATH_2D_DIST_PT_PT_SQUARED,FZ_MATH_2D_PT_PT_DIST, 
		FZ_MATH_2D_IS_EQUAL_PTS,FZ_MATH_2D_DOT_PROD,FZ_MATH_2D_CREATE_VEC, 
		FZ_MATH_2D_ADD_XY,FZ_MATH_2D_MID_PT,FZ_MATH_2D_INTERP_X,FZ_MATH_2D_INTERP_Y, 
		FZ_MATH_2D_PT_SIDE_OF_LINE,FZ_MATH_2D_AREA_OF_3_PTS

 ****************************************************************/
#define FZ_MATH_2D_SCALE_XY(_xy_in,_scale,_xy_out)	\
	do	{	(_xy_out)->x = (_xy_in)->x * (_scale); 	\
			(_xy_out)->y = (_xy_in)->y * (_scale); 	\
		} while (0)

/****************************************************************

	FZ_MATH_2D_ADD_XY


	Description
		Adds one xy to another.

	Parameters
		fz_xy_td * _xy1  [Input]
			xy 1.
		fz_xy_td * _xy2  [Input]
			xy 2.
		fz_xy_td * _xy_out  [Result]
			added xy.

	Returns
		none


	Availability	5.0.0.0


	See Also
		FZ_MATH_2D_VEC_LEN_SQUARED,FZ_MATH_2D_DIST_PT_PT_SQUARED,FZ_MATH_2D_PT_PT_DIST, 
		FZ_MATH_2D_IS_EQUAL_PTS,FZ_MATH_2D_DOT_PROD,FZ_MATH_2D_CREATE_VEC,FZ_MATH_2D_SCALE_XY, 
		FZ_MATH_2D_MID_PT,FZ_MATH_2D_INTERP_X,FZ_MATH_2D_INTERP_Y, 
		FZ_MATH_2D_PT_SIDE_OF_LINE,FZ_MATH_2D_AREA_OF_3_PTS

 ****************************************************************/
#define FZ_MATH_2D_ADD_XY(_xy1,_xy2,_xy_out)		\
	do	{	(_xy_out)->x = (_xy1)->x + (_xy2)->x; 	\
			(_xy_out)->y = (_xy1)->y + (_xy2)->y; 	\
		} while (0)

/****************************************************************

	FZ_MATH_2D_MID_PT


	Description
		Creates the midpoint between two 2d points. 
		Between point 1(_p1) and point 2(_p2).

	Parameters
		fz_xy_td * _p1  [Input]
			2d point 1.
		fz_xy_td * _p2  [Input]
			2d point 2.
		fz_xy_td * _mid_pt  [Result]
			2d midpoint.

	Returns
		none


	Availability	5.0.0.0


	See Also
		FZ_MATH_2D_VEC_LEN_SQUARED,FZ_MATH_2D_DIST_PT_PT_SQUARED,FZ_MATH_2D_PT_PT_DIST, 
		FZ_MATH_2D_IS_EQUAL_PTS,FZ_MATH_2D_DOT_PROD,FZ_MATH_2D_CREATE_VEC,FZ_MATH_2D_SCALE_XY, 
		FZ_MATH_2D_ADD_XY,FZ_MATH_2D_INTERP_X,FZ_MATH_2D_INTERP_Y, 
		FZ_MATH_2D_PT_SIDE_OF_LINE,FZ_MATH_2D_AREA_OF_3_PTS

 ****************************************************************/
#define FZ_MATH_2D_MID_PT(_p1,_p2,_mid_pt)					\
	do	{	(_mid_pt)->x = ((_p2)->x + (_p1)->x) * 0.5; 	\
			(_mid_pt)->y = ((_p2)->y + (_p1)->y) * 0.5; 	\
		} while (0)
		

/****************************************************************

	FZ_MATH_2D_INTERP_X


	Description
		Given a 2d line defined by two 2d points (_p1 and _p2) and a y value (_yval), 
		interpolates the x value of the 2d point which is on the line at the given y value.

	Parameters
		fz_xy_td * _p1  [Input]
			2d point 1 of line definition.
		fz_xy_td * _p2  [Input]
			2d point 2 of line definition.
		double _yval  [Input]
			y value of point.

	Returns
		x value of the 2d point on the line that is shared by y.



	Availability	5.0.0.0


	See Also
		FZ_MATH_2D_VEC_LEN_SQUARED,FZ_MATH_2D_DIST_PT_PT_SQUARED,FZ_MATH_2D_PT_PT_DIST, 
		FZ_MATH_2D_IS_EQUAL_PTS,FZ_MATH_2D_DOT_PROD,FZ_MATH_2D_CREATE_VEC,FZ_MATH_2D_SCALE_XY, 
		FZ_MATH_2D_ADD_XY,FZ_MATH_2D_MID_PT,FZ_MATH_2D_INTERP_Y, 
		FZ_MATH_2D_PT_SIDE_OF_LINE,FZ_MATH_2D_AREA_OF_3_PTS

 ****************************************************************/
#define FZ_MATH_2D_INTERP_X(_p1,_p2,_yval) ((fabs((_p2)->y - (_p1)->y) < FZ_MATH_TOL_LIN) ? (_p1)->x : \
										((_p1)->x + (((_yval) - (_p1)->y) / ((_p2)->y - (_p1)->y)) * ((_p2)->x - (_p1)->x)))

/****************************************************************

	FZ_MATH_2D_INTERP_Y


	Description
		Given a 2d line defined by two 2d points (_p1 and _p2) and an x value (_xval), 
		interpolate the y value of the 2d point which is on the line at the given x value

	Parameters
		fz_xy_td * _p1  [Input]
			2d point 1 of line definition.
		fz_xy_td * _p2  [Input]
			2d point 2 of line definition.
		double _xval  [Input]
			x value of point.

	Returns
		y value of the 2d point on the line that is shared by x.



	Availability	5.0.0.0


	See Also
		FZ_MATH_2D_VEC_LEN_SQUARED,FZ_MATH_2D_DIST_PT_PT_SQUARED,FZ_MATH_2D_PT_PT_DIST, 
		FZ_MATH_2D_IS_EQUAL_PTS,FZ_MATH_2D_DOT_PROD,FZ_MATH_2D_CREATE_VEC,FZ_MATH_2D_SCALE_XY, 
		FZ_MATH_2D_ADD_XY,FZ_MATH_2D_MID_PT,FZ_MATH_2D_INTERP_X, 
		FZ_MATH_2D_PT_SIDE_OF_LINE,FZ_MATH_2D_AREA_OF_3_PTS

 ****************************************************************/
#define FZ_MATH_2D_INTERP_Y(_p1,_p2,_xval) ((fabs((_p2)->x - (_p1)->x) < FZ_MATH_TOL_LIN) ? (_p1)->y : \
										((_p1)->y + (((_xval) - (_p1)->x) / ((_p2)->x - (_p1)->x)) * ((_p2)->y - (_p1)->y)))

/****************************************************************

	FZ_MATH_2D_PT_SIDE_OF_LINE


	Description
		Given a 2d line defined by two 2d points (_p1 and _p2), checks whether a 2d point (_pt) 
		is on the left or right side of the line, looking from _p1 to _p2. 
		Note : this macro does not determine if a point is on the line. 
		Points exactly on the line or very close to the line are subject to 
		mathematical accuracy errors.

	Parameters
		fz_xy_td * _p1  [Input]
			2d point 1 of line definition.
		fz_xy_td * _p2  [Input]
			2d point 2 of line definition.
		fz_xy_td * _pt  [Input]
			2d point to check which side of the line it is on.

	Returns
		-1 if on the left side, 1 if on the right side



	Availability	5.0.0.0


	See Also
		FZ_MATH_2D_VEC_LEN_SQUARED,FZ_MATH_2D_DIST_PT_PT_SQUARED,FZ_MATH_2D_PT_PT_DIST, 
		FZ_MATH_2D_IS_EQUAL_PTS,FZ_MATH_2D_DOT_PROD,FZ_MATH_2D_CREATE_VEC,FZ_MATH_2D_SCALE_XY, 
		FZ_MATH_2D_ADD_XY,FZ_MATH_2D_MID_PT,FZ_MATH_2D_INTERP_X,FZ_MATH_2D_INTERP_Y, 
		FZ_MATH_2D_AREA_OF_3_PTS

 ****************************************************************/
#define FZ_MATH_2D_PT_SIDE_OF_LINE(_p1,_p2,_pt) (((_p1)->y*(_p2)->x - (_p1)->x*(_p2)->y + \
												(_p2)->y*(_pt)->x - (_p2)->x*(_pt)->y + \
												(_pt)->y*(_p1)->x - (_pt)->x*(_p1)->y) > 0.0 ? 1 : -1)


/****************************************************************

	FZ_MATH_2D_AREA_OF_3_PTS


	Description
		Calculates the area of a triangle defined by three 2d points. 
		The area is positive if the three points are oriented clockwise 
		and negative if they are oriented counterclockwise.

	Parameters
		fz_xy_td * _p1  [Input]
			2d point 1 of triangle definition.
		fz_xy_td * _p2  [Input]
			2d point 2 of triangle definition.
		fz_xy_td * _p3  [Input]
			2d point 3 of triangle definition.

	Returns
		area of triangle



	Availability	5.0.0.0


	See Also
		FZ_MATH_2D_VEC_LEN_SQUARED,FZ_MATH_2D_DIST_PT_PT_SQUARED,FZ_MATH_2D_PT_PT_DIST, 
		FZ_MATH_2D_IS_EQUAL_PTS,FZ_MATH_2D_DOT_PROD,FZ_MATH_2D_CREATE_VEC,FZ_MATH_2D_SCALE_XY, 
		FZ_MATH_2D_ADD_XY,FZ_MATH_2D_MID_PT,FZ_MATH_2D_INTERP_X,FZ_MATH_2D_INTERP_Y, 
		FZ_MATH_2D_PT_SIDE_OF_LINE, 
		fz_math_3d_area_of_3_pts

 ****************************************************************/
#define FZ_MATH_2D_AREA_OF_3_PTS(_p1,_p2,_p3) (((_p1)->y * (_p2)->x - (_p1)->x * (_p2)->y + \
											(_p2)->y * (_p3)->x - (_p2)->x * (_p3)->y + \
											(_p3)->y * (_p1)->x - (_p3)->x * (_p1)->y) * 0.5)


/****************************************************************

	FZ_MATH_3D_VEC_LEN_SQUARED


	Description
		Computes the squared length of a 3d vector.

	Parameters
		fz_xyz_td * _vec  [Input]
			3d vector.

	Returns
		squared 3d vector length



	Availability	5.0.0.0


	See Also
		FZ_MATH_3D_DIST_PT_PT_SQUARED,FZ_MATH_3D_DIST_PT_PT, 
		FZ_MATH_3D_DIST_PT_PLANE,FZ_MATH_3D_IS_EQUAL_PTS,FZ_MATH_3D_CREATE_VEC, 
		FZ_MATH_3D_SCALE_XYZ,FZ_MATH_3D_ADD_XYZ,FZ_MATH_3D_MID_PT,FZ_MATH_3D_DOT_PROD

 ****************************************************************/
#define FZ_MATH_3D_VEC_LEN_SQUARED(_vec)	((_vec)->x * (_vec)->x + (_vec)->y * (_vec)->y + (_vec)->z * (_vec)->z)

/****************************************************************

	FZ_MATH_3D_DIST_PT_PT_SQUARED


	Description
		Computes the squared distance between two 3d points.

	Parameters
		fz_xyz_td * _p1  [Input]
			3d point 1.
		fz_xyz_td * _p2  [Input]
			3d point 2.

	Returns
		squared distance between the two 3d points


	Availability	5.0.0.0


	See Also
		FZ_MATH_3D_VEC_LEN_SQUARED,FZ_MATH_3D_DIST_PT_PT, 
		FZ_MATH_3D_DIST_PT_PLANE,FZ_MATH_3D_IS_EQUAL_PTS,FZ_MATH_3D_CREATE_VEC, 
		FZ_MATH_3D_SCALE_XYZ,FZ_MATH_3D_ADD_XYZ,FZ_MATH_3D_MID_PT,FZ_MATH_3D_DOT_PROD

 ****************************************************************/
#define FZ_MATH_3D_DIST_PT_PT_SQUARED(_p1,_p2)	( 	((_p2)->x - (_p1)->x) * ((_p2)->x - (_p1)->x) + \
												((_p2)->y - (_p1)->y) * ((_p2)->y - (_p1)->y) + \
												((_p2)->z - (_p1)->z) * ((_p2)->z - (_p1)->z) )

/****************************************************************

	FZ_MATH_3D_DIST_PT_PT


	Description
		Computes the distance between two 3d points.

	Parameters
		fz_xyz_td * _p1  [Input]
			3d point 1.
		fz_xyz_td * _p2  [Input]
			3d point 2.

	Returns
		distance between the two 3d points



	Availability	5.0.0.0


	See Also
		FZ_MATH_3D_VEC_LEN_SQUARED,FZ_MATH_3D_DIST_PT_PT_SQUARED, 
		FZ_MATH_3D_DIST_PT_PLANE,FZ_MATH_3D_IS_EQUAL_PTS,FZ_MATH_3D_CREATE_VEC, 
		FZ_MATH_3D_SCALE_XYZ,FZ_MATH_3D_ADD_XYZ,FZ_MATH_3D_MID_PT,FZ_MATH_3D_DOT_PROD

 ****************************************************************/
#define FZ_MATH_3D_DIST_PT_PT(_p1,_p2)	(sqrt(FZ_MATH_3D_DIST_PT_PT_SQUARED(_p1,_p2)))

/****************************************************************

	FZ_MATH_3D_DIST_PT_PLANE


	Description
		Computes the perpendicular distance between a 3d point and a plane.

	Parameters
		fz_xyz_td * _pt  [Input]
			3d point.
		plane * _plane  [Input]
			plane.

	Returns
		distance between the 3d point and the plane



	Availability	5.0.0.0


	See Also
		FZ_MATH_3D_VEC_LEN_SQUARED,FZ_MATH_3D_DIST_PT_PT_SQUARED,FZ_MATH_3D_DIST_PT_PT, 
		FZ_MATH_3D_IS_EQUAL_PTS,FZ_MATH_3D_CREATE_VEC, 
		FZ_MATH_3D_SCALE_XYZ,FZ_MATH_3D_ADD_XYZ,FZ_MATH_3D_MID_PT,FZ_MATH_3D_DOT_PROD, 
		fz_math_3d_dist_pt_line

 ****************************************************************/
#define FZ_MATH_3D_DIST_PT_PLANE(_pt,_plane)	((_pt)->x * (_plane)->a + (_pt)->y * (_plane)->b + (_pt)->z * (_plane)->c + (_plane)->d)

/****************************************************************

	FZ_MATH_3D_IS_EQUAL_PTS


	Description
		Check whether two 3d points are equal.

	Parameters
		fz_xyz_td * _p1  [Input]
			3d point 1.
		fz_xyz_td * _p2  [Input]
			3d point 2.

	Returns
		TRUE if equal, FALSE otherwise



	Availability	5.0.0.0


	See Also
		FZ_MATH_3D_VEC_LEN_SQUARED,FZ_MATH_3D_DIST_PT_PT_SQUARED,FZ_MATH_3D_DIST_PT_PT, 
		FZ_MATH_3D_DIST_PT_PLANE,FZ_MATH_3D_CREATE_VEC, 
		FZ_MATH_3D_SCALE_XYZ,FZ_MATH_3D_ADD_XYZ,FZ_MATH_3D_MID_PT,FZ_MATH_3D_DOT_PROD

 ****************************************************************/
#define FZ_MATH_3D_IS_EQUAL_PTS(_p1,_p2) ((FZ_MATH_3D_DIST_PT_PT_SQUARED(_p1,_p2) < FZ_MATH_TOL_LIN_SQUARED) ? TRUE : FALSE)

/****************************************************************

	FZ_MATH_3D_CREATE_VEC


	Description
		Creates a 3d vector from two 3d points. 
		From point 1 (_p1) to point 2 (_p2)

	Parameters
		fz_xyz_td * _p1  [Input]
			3d point 1.
		fz_xyz_td * _p2  [Input]
			3d point 2.
		fz_xyz_td * _vec  [Result]
			3d vector.

	Returns
		none


	Availability	5.0.0.0


	See Also
		FZ_MATH_3D_VEC_LEN_SQUARED,FZ_MATH_3D_DIST_PT_PT_SQUARED,FZ_MATH_3D_DIST_PT_PT, 
		FZ_MATH_3D_DIST_PT_PLANE,FZ_MATH_3D_IS_EQUAL_PTS, 
		FZ_MATH_3D_SCALE_XYZ,FZ_MATH_3D_ADD_XYZ,FZ_MATH_3D_MID_PT,FZ_MATH_3D_DOT_PROD

 ****************************************************************/
#define FZ_MATH_3D_CREATE_VEC(_p1,_p2,_vec)		\
	do	{	(_vec)->x = (_p2)->x - (_p1)->x; 	\
			(_vec)->y = (_p2)->y - (_p1)->y; 	\
			(_vec)->z = (_p2)->z - (_p1)->z; 	\
		} while (0)

/****************************************************************

	FZ_MATH_3D_SCALE_XYZ


	Description
		Scales an xyz by a factor.

	Parameters
		fz_xyz_td * _xyz_in  [Input]
			xyz to be scaled.
		fz_xyz_td * _scale  [Input]
			scale factor.
		fz_xyz_td * _xyz_out  [Result]
			scaled xyz.

	Returns
		none


	Availability	5.0.0.0


	See Also
		FZ_MATH_3D_VEC_LEN_SQUARED,FZ_MATH_3D_DIST_PT_PT_SQUARED,FZ_MATH_3D_DIST_PT_PT, 
		FZ_MATH_3D_DIST_PT_PLANE,FZ_MATH_3D_IS_EQUAL_PTS,FZ_MATH_3D_CREATE_VEC, 
		FZ_MATH_3D_ADD_XYZ,FZ_MATH_3D_MID_PT,FZ_MATH_3D_DOT_PROD

 ****************************************************************/
#define FZ_MATH_3D_SCALE_XYZ(_xyz_in,_scale,_xyz_out)	\
	do	{	(_xyz_out)->x = (_xyz_in)->x * (_scale); 	\
			(_xyz_out)->y = (_xyz_in)->y * (_scale); 	\
			(_xyz_out)->z = (_xyz_in)->z * (_scale); 	\
		} while (0)

/****************************************************************

	FZ_MATH_3D_ADD_XYZ


	Description
		Adds one xyz to another.

	Parameters
		fz_xyz_td * _xyz1  [Input]
			xyz 1.
		fz_xyz_td * _xyz2  [Input]
			xyz 2.
		fz_xyz_td * _xyz_out  [Result]
			added xyz.

	Returns
		none


	Availability	5.0.0.0


	See Also
		FZ_MATH_3D_VEC_LEN_SQUARED,FZ_MATH_3D_DIST_PT_PT_SQUARED,FZ_MATH_3D_DIST_PT_PT, 
		FZ_MATH_3D_DIST_PT_PLANE,FZ_MATH_3D_IS_EQUAL_PTS,FZ_MATH_3D_CREATE_VEC, 
		FZ_MATH_3D_SCALE_XYZ,FZ_MATH_3D_MID_PT,FZ_MATH_3D_DOT_PROD

 ****************************************************************/
#define FZ_MATH_3D_ADD_XYZ(_xyz1,_xyz2,_xyz_out)		\
	do	{	(_xyz_out)->x = (_xyz1)->x + (_xyz2)->x; 	\
			(_xyz_out)->y = (_xyz1)->y + (_xyz2)->y; 	\
			(_xyz_out)->z = (_xyz1)->z + (_xyz2)->z; 	\
		} while (0)

/****************************************************************

	FZ_MATH_3D_SUBTRACT_XYZ


	Description
		Subtracts the second xyz from the first xyz. The result is placed 
		in the third xyz.

	Parameters
		fz_xyz_td * _xyz1  [Input]
			xyz 1.
		fz_xyz_td * _xyz2  [Input]
			xyz 2.
		fz_xyz_td * _xyz_out  [Result]
			result of xyz1 - xyz2.

	Returns
		none


	Availability	7.0.0.0


	See Also
		FZ_MATH_3D_VEC_LEN_SQUARED,FZ_MATH_3D_DIST_PT_PT_SQUARED,FZ_MATH_3D_DIST_PT_PT, 
		FZ_MATH_3D_DIST_PT_PLANE,FZ_MATH_3D_IS_EQUAL_PTS,FZ_MATH_3D_CREATE_VEC, 
		FZ_MATH_3D_SCALE_XYZ,FZ_MATH_3D_MID_PT,FZ_MATH_3D_DOT_PROD

 ****************************************************************/
#define FZ_MATH_3D_SUBTRACT_XYZ(_xyz1,_xyz2,_xyz_out)		\
	do	{	(_xyz_out)->x = (_xyz1)->x - (_xyz2)->x; 	\
			(_xyz_out)->y = (_xyz1)->y - (_xyz2)->y; 	\
			(_xyz_out)->z = (_xyz1)->z - (_xyz2)->z; 	\
		} while (0)

/****************************************************************

	FZ_MATH_3D_MID_PT


	Description
		Creates the midpoint between two 3d points. 
		Between point 1(_p1) and point 2(_p2).

	Parameters
		fz_xyz_td * _p1  [Input]
			3d point 1.
		fz_xyz_td * _p2  [Input]
			3d point 2.
		fz_xyz_td * _mid_pt  [Result]
			3d midpoint.

	Returns
		none


	Availability	5.0.0.0


	See Also
		FZ_MATH_3D_VEC_LEN_SQUARED,FZ_MATH_3D_DIST_PT_PT_SQUARED,FZ_MATH_3D_DIST_PT_PT, 
		FZ_MATH_3D_DIST_PT_PLANE,FZ_MATH_3D_IS_EQUAL_PTS,FZ_MATH_3D_CREATE_VEC, 
		FZ_MATH_3D_SCALE_XYZ,FZ_MATH_3D_ADD_XYZ,FZ_MATH_3D_DOT_PROD

 ****************************************************************/
#define FZ_MATH_3D_MID_PT(_p1,_p2,_mid_pt)					\
	do	{	(_mid_pt)->x = ((_p2)->x + (_p1)->x) * 0.5; 	\
			(_mid_pt)->y = ((_p2)->y + (_p1)->y) * 0.5; 	\
			(_mid_pt)->z = ((_p2)->z + (_p1)->z) * 0.5; 	\
		} while (0)

/****************************************************************

	FZ_MATH_3D_DOT_PROD


	Description
		Computes the dot product of two 3d vectors.

	Parameters
		fz_xyz_td * _p1  [Input]
			3d vector 1.
		fz_xyz_td * _p2  [Input]
			3d vector 2.

	Returns
		dot product of the two 3d vectors



	Availability	5.0.0.0


	See Also
		FZ_MATH_3D_VEC_LEN_SQUARED,FZ_MATH_3D_DIST_PT_PT_SQUARED,FZ_MATH_3D_DIST_PT_PT, 
		FZ_MATH_3D_DIST_PT_PLANE,FZ_MATH_3D_IS_EQUAL_PTS,FZ_MATH_3D_CREATE_VEC, 
		FZ_MATH_3D_SCALE_XYZ,FZ_MATH_3D_ADD_XYZ,FZ_MATH_3D_MID_PT

 ****************************************************************/
#define FZ_MATH_3D_DOT_PROD(_vec1,_vec2)	( (_vec1)->x * (_vec2)->x + (_vec1)->y * (_vec2)->y + (_vec1)->z * (_vec2)->z )


/****************************************************************

	fz_math_err_enum


	Description
		error error codes.

	Members
		FZ_MATH_ERR_VEC_PARALLEL
			error Error : Two vectors are parallel or opposite direction parallel within MATH_TOL_ANG_ZERO
		FZ_MATH_ERR_ZERO_LEN_VEC
			error Error : A vector is zero length. Zero, meaning its squared length is less than MATH_TOL_LIN_SQUARED
		FZ_MATH_ERR_VEC_NON_PERP
			error Error : Two vectors are not perpendicular to each other. Uses MATH_TOL_COS_ANG_90 to define perpendicular
		FZ_MATH_ERR_VEC_PLANE_PARALLEL
			error Error : A line and plane are parallel
		FZ_MATH_ERR_PLANES_PARALLEL
			error Error : Two or more planes are parallel
		FZ_MATH_ERR_LINES_ON_DIFF_PLANES
			error Error : Two lines are on different planes
		FZ_MATH_ERR_MAT_UNSOLVABLE
			error Error : Can't solve a matrix

	Availability	5.0.0.0

 ****************************************************************/
typedef enum fz_math_err_enum
{	FZ_MATH_ERR_VEC_PARALLEL = 1,
	FZ_MATH_ERR_ZERO_LEN_VEC,
	FZ_MATH_ERR_VEC_NON_PERP,
	FZ_MATH_ERR_VEC_PLANE_PARALLEL,
	FZ_MATH_ERR_PLANES_PARALLEL,
	FZ_MATH_ERR_LINES_ON_DIFF_PLANES,
	FZ_MATH_ERR_MAT_UNSOLVABLE,
	
	MATH_ERR_MAX
}  fz_math_err_enum;

/****************************************************************

	fz_math_random_range



	Description
		Generates a random number in the range min ... max.

	Parameters
		min  [Input]
			minimum value of the random number
		max  [Input]
			maximum value of the random number

	Returns
		Randomly generated number


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl

	See Also
		fz_math_is_valid_double

 ****************************************************************/
typedef double	 (*fz_math_random_range_func)(
	double			min,
	double			max
	);

/****************************************************************

	fz_math_is_valid_double



	Description
		Checks whether a double is in a valid range 
		(i.e. not a corrupt number).

	Parameters
		val  [Input]
			value to be range checked

	Returns
		TRUE if valid, FALSE otherwise


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl

	See Also
		fz_math_random_range

 ****************************************************************/
typedef fzrt_boolean	 (*fz_math_is_valid_double_func)(
	double			val
	);

/****************************************************************

	fz_math_2d_is_zero_len_vec



	Description
		Checks whether a 2d vector is zero length.

	Parameters
		vec  [Input]
			2d vector to be checked

	Returns
		TRUE if zero length, FALSE otherwise


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl

	See Also
		fz_math_2d_is_unit_len_vec,fz_math_3d_is_zero_len_vec

 ****************************************************************/
typedef fzrt_boolean	 (*fz_math_2d_is_zero_len_vec_func)(
	fz_xy_td			*vec
	);

/****************************************************************

	fz_math_2d_is_unit_len_vec



	Description
		Checks whether a 2d vector is equal to the unit length 
		(unit length equals 1.0).

	Parameters
		vec  [Input]
			2d vector to be checked

	Returns
		TRUE if equal to the unit length, FALSE otherwise


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl

	See Also
		fz_math_2d_is_zero_len_vec,fz_math_3d_is_unit_len_vec

 ****************************************************************/
typedef fzrt_boolean	 (*fz_math_2d_is_unit_len_vec_func)(
	fz_xy_td			*vec
	);

/****************************************************************

	fz_math_2d_is_pt_between_pts



	Description
		Checks whether a 2d point is between two other 2d points. 
		The largest projection of the line is used to establish "between".

	Parameters
		p1  [Input]
			2d point 1 to check against
		p2  [Input]
			2d point 2 to check against
		pt  [Input]
			2d point to be checked

	Returns
		TRUE if point is between, FALSE otherwise


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl

	See Also
		fz_math_3d_is_pt_between_pts

 ****************************************************************/
typedef fzrt_boolean	 (*fz_math_2d_is_pt_between_pts_func)(
	fz_xy_td			*p1,
	fz_xy_td			*p2,
	fz_xy_td			*pt
	);

/****************************************************************

	fz_math_2d_angle_of_line_seg



	Description
		Finds the angle of a 2d line segment (defined by it's start and end points) in 2d space. 
		The angle is measured from the positive x axis (3 o'clock position) 
		with a positive rotation defined as counter-clockwise. 
		The angle is returned in radians.

	Parameters
		line_start  [Input]
			start point of line segment
		line_end  [Input]
			end point of line segment
		angle  [Result]
			angle of the line segment

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl
 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_2d_angle_of_line_seg_func)(
	fz_xy_td			*line_start,
	fz_xy_td			*line_end,
	double			*angle
	);

/****************************************************************

	fz_math_2d_normalize_vec



	Description
		Given a 2d vector, creates the normalized (unit) 2d vector. 
		Note : vec and unit_vec can be passed as the same pointer.

	Parameters
		vec  [Input]
			2d vector
		unit_vec  [Result]
			normalized 2d vector

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl

	See Also
		fz_math_3d_normalize_vec

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_2d_normalize_vec_func)(
	fz_xy_td			*vec,
	fz_xy_td			*unit_vec
	);

/****************************************************************

	fz_math_2d_perp_vec



	Description
		Given a 2d vector, returns the perpendicular 2d vector. 
		This is equivalent to the cross product of two 3d vectors. 
		The resulting vector is NOT normalized. 
		Note : vec and norm can be passed as the same pointer.

	Parameters
		vec  [Input]
			2d vector
		norm  [Result]
			perpendicular 2d vector (not normalized)

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl

	See Also
		fz_math_3d_cross_prod

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_2d_perp_vec_func)(
	fz_xy_td			*vec,
	fz_xy_td			*norm
	);

/****************************************************************

	fz_math_2d_pt_at_dist_ang



	Description
		Finds a 2d point (new_pt) at a distance (dist) and angle (angle) 
		from a 2d base point (base_pt).

	Parameters
		base_pt  [Input]
			2d base point
		dist  [Input]
			distance
		angle  [Input]
			angle
		new_pt  [Result]
			2d new point

	Returns
		None


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl
 ****************************************************************/
typedef void	 (*fz_math_2d_pt_at_dist_ang_func)(
	fz_xy_td			*base_pt,
	double			dist,
	double			angle,
	fz_xy_td			*new_pt
	);

/****************************************************************

	fz_math_2d_center_3pt_circle



	Description
		Finds the center point for a circle, defined by three 2d points.

	Parameters
		p1  [Input]
			2d point 1
		p2  [Input]
			2d point 2
		p3  [Input]
			2d point 3
		center  [Result]
			center of circle

	Returns
		Error codes 
		FZ_MATH_ERR_VEC_PARALLEL - the three circle points are colinear 
		FZ_MATH_ERR_ZERO_LEN_VEC - at least two of the input points are equal


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl

	See Also
		fz_math_2d_isect_circle_line_equ,fz_math_2d_equs_from_circle_tang

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_2d_center_3pt_circle_func)(
	fz_xy_td			*p1,
	fz_xy_td			*p2,
	fz_xy_td			*p3,
	fz_xy_td			*center
	);

/****************************************************************

	fz_math_2d_isect_line_segs



	Description
		Calculates the 2d intersection point of two 2d line segments 
		(defined by their start and end points). 
		The int_kase result indicates how the line segments intersect, if no error occurred. 
		If an error occurred, int_kase is always set to 0x00000000. 
		The results in int_kase are bit encoded as follows : 
		 
		bit 0 == 0 lines don't intersect, only their extensions do. Or an error occurred. 
		bit 0 == 1 a true intersection occurred (intersection point is on either line. i.e. segment check) 
		 
		Details about the intersection : 
		 
		0x00000002 int_pt is on line1_start 
		0x00000004 int_pt is on line1_end 
		0x00000008 int_pt is between line1_start and line1_end 
		0x00000010 int_pt is on line2_start 
		0x00000020 int_pt is on line2_end 
		0x00000040 int_pt is between line2_start and line2_end

	Parameters
		line1_start  [Input]
			start point of 2d line segment 1
		line1_end  [Input]
			end point of 2d line segment 1
		line2_start  [Input]
			start point of 2d line segment 2
		line2_end  [Input]
			end point of 2d line segment 2
		int_pt  [Result]
			2d intersection point of the line segments
		int_kase  [Result, Optional]
			how the line segments interact

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl

	See Also
		fz_math_2d_isect_line_equs,fz_math_2d_isect_circle_line_equ, 
		fz_math_3d_isect_lines

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_2d_isect_line_segs_func)(
	fz_xy_td			*line1_start,
	fz_xy_td			*line1_end,
	fz_xy_td			*line2_start,
	fz_xy_td			*line2_end,
	fz_xy_td			*int_pt,
	fzrt_int			*int_kase
	);

/****************************************************************

	fz_math_2d_project_pt_on_line_seg



	Description
		Given a 2d line segment(defined by it's start and end points), 
		finds the 2d point on the line segment that is perpendicular to a given 2d point. 
		Optionally, returned can be : 
		dist : the distance (dist_squared == FALSE) or squared distance (dist_squared == TRUE) 
		of the original point from the line segment 
		kase : bit encoded, where the point lies with respect to the two line points 
		0x00000000		line_pt in not between line_start and line_end 
		0x00000001		line_pt is on line_start 
		0x00000002		line_pt is on line_end 
		0x00000004		line_pt is between line_start and line_end

	Parameters
		line_start  [Input]
			start point of 2d line segment
		line_end  [Input]
			end point of 2d line segment
		pt  [Input]
			original 2d point
		dist_squared  [Input]
			whether or not the returned distance should be squared
		line_pt  [Result, Optional]
			2d point perpendicular to the original point
		dist  [Result, Optional]
			distance of the original point from 
			the line segment 
			(squared distance if dist_squared is TRUE)
		kase  [Result, Optional]
			where the perpendicular point lies 
			with respect to the two line points

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl

	See Also
		fz_math_3d_project_pt_on_line

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_2d_project_pt_on_line_seg_func)(
	fz_xy_td			*line_start,
	fz_xy_td			*line_end,
	fz_xy_td			*pt,
	fzrt_boolean	dist_squared,
	fz_xy_td			*line_pt,
	double			*dist,
	fzrt_int			*kase
	);

/****************************************************************

	fz_math_2d_equ_from_line_seg



	Description
		Given a 2d line segment (defined by it's start and end points), 
		calculates the 2d line equation (defined by it's slope and offset). 
		The optional kase parameter returns whether the line is 
		horizontal (1), vertical (2) or at an arbitrary angle (0).

	Parameters
		line_seg_start  [Input]
			start point of 2d line segment
		line_seg_end  [Input]
			end point of 2d line segment
		line_equ_a  [Result]
			slope of 2d line equation
		line_equ_c  [Result]
			offset of 2d line equation
		kase  [Result, Optional]
			information about the line

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl

	See Also
		fz_math_2d_line_seg_from_equ

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_2d_equ_from_line_seg_func)(
	fz_xy_td			*line_seg_start,
	fz_xy_td			*line_seg_end,
	double			*line_equ_a,
	double			*line_equ_c,
	fzrt_int			*kase
	);

/****************************************************************

	fz_math_2d_line_seg_from_equ



	Description
		Given a 2d line equation (defined by it's slope and offset), 
		creates a 2d unit length line segment (defined by it's start and end points). 
		Note : the start and end point of the line segment are chosen arbitrarily.

	Parameters
		line_equ_a  [Input]
			slope of 2d line equation
		line_equ_c  [Input]
			offset of 2d line equation
		line_start  [Result]
			start point of 2d line segment
		line_end  [Result]
			end point of 2d line segment

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl

	See Also
		fz_math_2d_equ_from_line_seg

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_2d_line_seg_from_equ_func)(
	double			line_equ_a,
	double			line_equ_c,
	fz_xy_td			*line_start,
	fz_xy_td			*line_end
	);

/****************************************************************

	fz_math_2d_parl_line_equ



	Description
		Given a 2d line equation (defined by it's slope and offset), 
		a left/right flag (left_side) and an offset, 
		calculates the 2d line equation (defined by it's slope and offset) 
		of a parallel line. 
		The optional kase parameter returns whether the line is 
		horizontal (1), vertical (2) or at an arbitrary angle (0).

	Parameters
		line_in_a  [Input]
			slope of original 2d line equation
		line_in_c  [Input]
			offset of original 2d line equation
		offset  [Input]
			offset of parallel line from original line
		left_side  [Input]
			if TRUE, offset parallel line to the left of original line, 
			otherwise offset to the right
		line_out_a  [Result]
			slope of parallel 2d line equation
		line_out_c  [Result]
			offset of parallel 2d line equation
		kase  [Result, Optional]
			information about the line

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl
 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_2d_parl_line_equ_func)(
	double			line_in_a,
	double			line_in_c,
	double			offset,
	fzrt_boolean	left_side,
	double			*line_out_a,
	double			*line_out_c,
	fzrt_int			*kase
	);

/****************************************************************

	fz_math_2d_equ_from_perp_line



	Description
		Given a 2d line segment (defined by it's start and end points) and a start/end flag (at_start), 
		calculates the 2d line equation (defined by it's slope and offset) 
		of a perpendicular line at the line start or end point. 
		The optional kase parameter returns whether the line is 
		horizontal (1), vertical (2) or at an arbitrary angle (0).

	Parameters
		line_seg_start  [Input]
			start point of 2d line segment
		line_seg_end  [Input]
			end point of 2d line segment
		at_start  [Input]
			if TRUE, the perpendicular line is at the start 
			point of the line segment, 
			otherwise the perpendicular line is at the end 
			point of the line segment
		line_equ_a  [Result]
			slope of perpendicular 2d line equation
		line_equ_c  [Result]
			offset of perpendicular 2d line equation
		kase  [Result, Optional]
			information about the line

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl
 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_2d_equ_from_perp_line_func)(
	fz_xy_td			*line_seg_start,
	fz_xy_td			*line_seg_end,
	fzrt_boolean	at_start,
	double			*line_equ_a,
	double			*line_equ_c,
	fzrt_int			*kase
	);

/****************************************************************

	fz_math_2d_isect_line_equs



	Description
		Calculates the intersection point of two 2d line equations (defined by their slope and offset).

	Parameters
		line1_a  [Input]
			slope of 2d line equation 1
		line1_c  [Input]
			offset of 2d line equation 1
		line2_a  [Input]
			slope of 2d line equation 2
		line2_c  [Input]
			offset of 2d line equation 2
		int_pt  [Result]
			intersection point

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl

	See Also
		fz_math_2d_isect_line_segs,fz_math_2d_isect_circle_line_equ, 
		fz_math_3d_isect_lines

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_2d_isect_line_equs_func)(
	double			line1_a,
	double			line1_c,
	double			line2_a,
	double			line2_c,
	fz_xy_td			*int_pt
	);

/****************************************************************

	fz_math_2d_colinear_3_pts_tol



	Description
		Given three 2d points, determines if they are colinear, using an 
		angle to define "colinear". 
		For efficiency, the angle passed in (cos_angle) must be the 
		cosine of the actual angle. 
		An appropriate angle is 0.1 degree for example.

	Parameters
		p1  [Input]
			2d point 1
		p2  [Input]
			2d point 2
		p3  [Input]
			2d point 3
		cos_angle  [Input]
			cosine of the angle used to define colinear
		is_colinear  [Result]
			TRUE if the points are colinear, 
			FALSE otherwise

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl

	See Also
		fz_math_2d_colinear_3_pts, 
		fz_math_3d_colinear_3_pts_tol

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_2d_colinear_3_pts_tol_func)(
	fz_xy_td			*p1,
	fz_xy_td			*p2,
	fz_xy_td			*p3,
	double			cos_angle,
	fzrt_boolean	*is_colinear
	);

/****************************************************************

	fz_math_2d_colinear_3_pts



	Description
		Given three 2d points, determines if they are colinear. 
		This function uses a system defined tolerance to determine colinearity.

	Parameters
		p1  [Input]
			2d point 1
		p2  [Input]
			2d point 2
		p3  [Input]
			2d point 3
		is_colinear  [Result]
			TRUE if the points are colinear, 
			FALSE otherwise

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl

	See Also
		fz_math_2d_colinear_3_pts_tol, 
		fz_math_3d_colinear_3_pts

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_2d_colinear_3_pts_func)(
	fz_xy_td			*p1,
	fz_xy_td			*p2,
	fz_xy_td			*p3,
	fzrt_boolean	*is_colinear
	);

/****************************************************************

	fz_math_2d_is_parl_line_segs



	Description
		Checks whether two 2d line segments (defined by their start and end points) are parallel.

	Parameters
		line1_start  [Input]
			start point of 2d line segment 1
		line1_end  [Input]
			end point of 2d line segment 1
		line2_start  [Input]
			start point of 2d line segment 2
		line2_end  [Input]
			end point of 2d line segment 2

	Returns
		TRUE if parallel, FALSE if not or at least one of the lines is zero length


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl

	See Also
		fz_math_3d_is_parl_lines

 ****************************************************************/
typedef fzrt_boolean	 (*fz_math_2d_is_parl_line_segs_func)(
	fz_xy_td			*line1_start,
	fz_xy_td			*line1_end,
	fz_xy_td			*line2_start,
	fz_xy_td			*line2_end
	);

/****************************************************************

	fz_math_2d_is_pt_on_line_equ



	Description
		Given a 2d line equation (defined by it's slope and offset) and a 2d point, 
		determines whether the point is on that line (within a tolerance).

	Parameters
		line_a  [Input]
			slope of 2d line equation
		line_c  [Input]
			offset of 2d line equation
		pt  [Input]
			2d point

	Returns
		TRUE if point is on the line (within a tolerance), FALSE otherwise


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl

	See Also
		fz_math_3d_is_pt_on_line

 ****************************************************************/
typedef fzrt_boolean	 (*fz_math_2d_is_pt_on_line_equ_func)(
	double			line_a,
	double			line_c,
	fz_xy_td			*pt
	);

/****************************************************************

	fz_math_2d_isect_circle_line_equ



	Description
		Calculates the intersection of a circle (defined by a center and radius) 
		and a line equation (defined by it's slope and offset). 
		Note : int_pts must be an array that can hold 2 2d points. 
		n_int_pts wil be returned as either 0, 1 or 2 and indicates how many 
		points are stored in int_pts.

	Parameters
		center  [Input]
			center of circle
		radius  [Input]
			radius of circle
		line_equ_a  [Input]
			slope of 2d line equation
		line_equ_c  [Input]
			offset of 2d line equation
		int_pts[2]  [Result]
			intersecting 2d points array
		n_int_pts  [Result]
			number of intersecting points

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl

	See Also
		fz_math_2d_isect_line_equs,fz_math_2d_isect_line_segs, 
		fz_math_2d_center_3pt_circle,fz_math_2d_equs_from_circle_tang

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_2d_isect_circle_line_equ_func)(
	fz_xy_td 			*center,
	double			radius,
	double			line_equ_a,
	double			line_equ_c,
	fz_xy_td			int_pts[2],
	fzrt_int			*n_int_pts
	);

/****************************************************************

	fz_math_2d_equ_from_pt_ang



	Description
		Given a 2d point and angle, calculates the 2d 
		line equation (defined by it's slope and offset). 
		The optional kase parameter returns whether the line is 
		horizontal (1), vertical (2) or at an arbitrary angle (0).

	Parameters
		pt  [Input]
			2d point
		angle  [Input]
			angle
		line_a  [Result]
			slope of 2d line equation
		line_c  [Result]
			offset of 2d line equation
		kase  [Result, Optional]
			information about the line equation

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl
 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_2d_equ_from_pt_ang_func)(
	fz_xy_td			*pt,
	double			angle,
	double			*line_a,
	double			*line_c,
	fzrt_int			*kase
	);

/****************************************************************

	fz_math_2d_equs_from_circle_tang



	Description
		Given a circle (defined by a center and radius) and a 2d point, 
		calculates the 2d tangent line equations (defined by it's slope and offset). 
		n_lines indicates whether there are 0, 1 or 2 solutions. 
		line_equs_a and line_equs_c are arrays that return the 
		slopes and offsets of 2d line equation(s) respectively. 
		They must be able to hold two entities each. 
		0 solutions : 	point is inside circle 
		1 solution	:	point is on circle 
		2 solutions :	point is outside circle

	Parameters
		center  [Input]
			center of circle
		radius  [Input]
			radius of circle
		pt  [Input]
			point
		line_equs_a[2]  [Result]
			slope of 2d tangent line equation(s)
		line_equs_c[2]  [Result]
			offset of 2d tangent line equation(s)
		n_lines  [Result]
			number of 2d tangent lines

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl

	See Also
		fz_math_2d_center_3pt_circle,fz_math_2d_isect_circle_line_equ

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_2d_equs_from_circle_tang_func)(
	fz_xy_td			*center,
	double			radius,
	fz_xy_td			*pt,
	double			line_equs_a[2],
	double			line_equs_c[2],
	fzrt_int			*n_lines
	);

/****************************************************************

	fz_math_2d_equ_from_line_pt_ang



	Description
		Given a line equation, a point on that line, and an angle, 
		finds the line equation (defined by it's slope and offset) which goes through 
		the point and encloses the given angle with the given line. 
		The optional kase parameter returns whether the line is 
		horizontal (1), vertical (2) or at an arbitrary angle (0).

	Parameters
		line_in_a  [Input]
			slope of 2d line equation
		line_in_c  [Input]
			offset of 2d line equation
		pt  [Input]
			2d point
		angle  [Input]
			angle
		line_out_a  [Result]
			slope of 2d line equation
		line_out_c  [Result]
			offset of 2d line equation
		kase  [Result, Optional]
			information about the line equation

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl
 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_2d_equ_from_line_pt_ang_func)(
	double			line_in_a,
	double			line_in_c,
	fz_xy_td			*pt,
	double			angle,
	double			*line_out_a,
	double			*line_out_c,
	fzrt_int			*kase
	);

/****************************************************************

	fz_math_2d_dist_pt_line_equ



	Description
		Calculates the perpendicular distance from a 2d point 
		to a 2d line equation (defined by it's slope and offset).

	Parameters
		line_a  [Input]
			slope of 2d line equation
		line_c  [Input]
			offset of 2d line equation
		pt  [Input]
			2d point
		dist  [Result]
			distance from point to line

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl

	See Also
		fz_math_2d_dist_pt_line_seg

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_2d_dist_pt_line_equ_func)(
	double			line_a,
	double			line_c,
	fz_xy_td			*pt,
	double			*dist
	);

/****************************************************************

	fz_math_2d_dist_pt_line_seg



	Description
		Calculates the perpendicular distance from a 2d point 
		to a 2d line segment (defined by it's start and end points). 
		The line segment is thought to extend infinitely.

	Parameters
		line_start  [Input]
			start point of 2d line segment
		line_end  [Input]
			end point of 2d line segment
		pt  [Input]
			2d point
		dist  [Result]
			distance from point to line segment

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl

	See Also
		fz_math_2d_dist_pt_line_equ, 
		fz_math_3d_dist_pt_line

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_2d_dist_pt_line_seg_func)(
	fz_xy_td			*line_start,
	fz_xy_td			*line_end,
	fz_xy_td			*pt,
	double			*dist
	);

/****************************************************************

	fz_math_2d_bisect_angle



	Description
		Calculates the 2d bisect vector of an angle defined by three 2d points 
		(pt1, center, pt2). 
		center is the apex of the angle formed by the 2d vectors (center, pt1) and 
		(center, pt2).

	Parameters
		pt1  [Input]
			2d point 1
		center  [Input]
			apex of the angle
		pt2  [Input]
			2d point 2
		bisect_vec  [Result]
			2d bisect vector

	Returns
		Error codes 
		FZ_MATH_ERR_ZERO_LEN_VEC - lines from pt1 to center or center to pt2 are zero length 
		FZ_MATH_ERR_VEC_PARALLEL - pt1, center, pt2 are colinear


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl

	See Also
		fz_math_3d_bisect_angle

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_2d_bisect_angle_func)(
	fz_xy_td			*pt1,
	fz_xy_td			*center,
	fz_xy_td			*pt2,
	fz_xy_td			*bisect_vec
	);

/****************************************************************

	fz_math_2d_interp_pt_on_line



	Description
		Given a 2d line segment (defined by it's start and end points) 
		and a ratio (between 0.0 and 1.0), 
		interpolates a 2d point on the line segment. 
		For example: 
		ratio 0.0 : point is at line_start 
		ratio 0.5 : point is the midpoint of the line segment 
		ratio 1.0 : point is at line_end

	Parameters
		line_start  [Input]
			start point of 2d line segment
		line_end  [Input]
			end point of 2d line segment
		ratio  [Input]
			ratio
			Range: 0.0
		pt  [Result]
			interpolated 2d point

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl

	See Also
		fz_math_3d_interp_pt_on_line

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_2d_interp_pt_on_line_func)(
	fz_xy_td			*line_start,
	fz_xy_td			*line_end,
	double			ratio,
	fz_xy_td			*pt
	);

/****************************************************************

	fz_math_2d_angle_of_2_lines



	Description
		Given an angle defined by three 2d points (pt1, center, pt2), 
		calculates the degrees of the angle. 
		center is the apex of the angle formed by the 2d vectors (center, pt1) and 
		(center, pt2).

	Parameters
		pt1  [Input]
			2d point 1
		center  [Input]
			apex of angle
		pt2  [Input]
			2d point 2
		angle  [Result]
			angle

	Returns
		Error codes 
		FZ_MATH_ERR_ZERO_LEN_VEC - lines from pt1 to center or center to pt2 are zero length


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl

	See Also
		fz_math_3d_angle_of_2_lines

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_2d_angle_of_2_lines_func)(
	fz_xy_td			*pt1,
	fz_xy_td			*center,
	fz_xy_td			*pt2,
	double			*angle
	);

/****************************************************************

	fz_math_2d_reflect_pt_about_pt



	Description
		Reflects a 2d point (pt_in) about another 2d point (center).

	Parameters
		pt_in  [Input]
			2d point to be reflected
		center  [Input]
			2d point to reflect about
		pt_out  [Result]
			reflected 2d point

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl

	See Also
		fz_math_3d_reflect_pt_about_pt

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_2d_reflect_pt_about_pt_func)(
	fz_xy_td			*pt_in,
	fz_xy_td			*center,
	fz_xy_td			*pt_out
	);

/****************************************************************

	fz_math_2d_reflect_pt_about_line



	Description
		Reflects a 2d point (pt_in) about a 2d line segment (defined by it's start and end points).

	Parameters
		pt_in  [Input]
			2d point to be reflected
		line_start  [Input]
			start point of 2d line segment to reflect about
		line_end  [Input]
			end point of 2d line segment to reflect about
		pt_out  [Result]
			reflected 2d point

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl

	See Also
		fz_math_3d_reflect_pt_about_line

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_2d_reflect_pt_about_line_func)(
	fz_xy_td			*pt_in,
	fz_xy_td			*line_start,
	fz_xy_td			*line_end,
	fz_xy_td			*pt_out
	);

/****************************************************************

	fz_math_2d_create_unit_vec



	Description
		Creates a unit length 2d vector from two 2d points.

	Parameters
		pt1  [Input]
			2d point 1
		pt2  [Input]
			2d point 2
		unit_vec  [Result]
			unit length 2d vector

	Returns
		Error codes 
		FZ_MATH_ERR_ZERO_LEN_VEC - the two 2d points are equal


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl

	See Also
		fz_math_3d_create_unit_vec

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_2d_create_unit_vec_func)(
	fz_xy_td			*pt1,
	fz_xy_td			*pt2,
	fz_xy_td			*unit_vec
	);

/****************************************************************

	fz_math_2d_is_pt_in_polygon



	Description
		Given a 2d point and a simple polygon (defined by a number of connected points) 
		checks whether the point is inside or outside the polygon. 
		npts indicates how many points are in the polygon, as passed in poly_pts. 
		Note : this is a fast test and does not determine whether the 
		point is on the polygon boundary.

	Parameters
		pt  [Input]
			2d point
		poly_pts  [Input]
			polygon points array
		npts  [Input]
			number of points in the polygon

	Returns
		TRUE if inside, FALSE if outside


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl

	See Also
		fz_math_2d_clip_line_seg_with_polygon,fz_math_2d_cog_of_polygon, 
		fz_math_2d_area_of_polygon,fz_math_2d_filter_polygon_pts

 ****************************************************************/
typedef fzrt_boolean	 (*fz_math_2d_is_pt_in_polygon_func)(
	fz_xy_td			*pt,
	fz_xy_td			*poly_pts,
	fzrt_int			npts
	);

/****************************************************************

	fz_math_2d_is_pt_on_polygon



	Description
		Given a 2d point and a simple polygon (defined by a number of connected points) 
		checks whether the point is on the boundary the polygon. 
		npts indicates how many points are in the polygon, as passed in poly_pts.

	Parameters
		pt  [Input]
			2d point
		poly_pts  [Input]
			polygon points array
		npts  [Input]
			number of points in the polygon

	Returns
		TRUE if on the boundary, FALSE if not


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl

	See Also
		fz_math_2d_is_pt_in_polygon

 ****************************************************************/
typedef fzrt_boolean	 (*fz_math_2d_is_pt_on_polygon_func)(
	fz_xy_td			*pt,
	fz_xy_td			*poly_pts,
	fzrt_int				npts
	);

/****************************************************************

	fz_math_2d_clip_line_seg_with_polygon



	Description
		Clips a line segment (defined by it's start and end points) with a polygon. 
		The polygon is defined as a set of curves. 
		The first curve is the outer boundary. 
		All other curves are assmued to be holes. 
		 
		The polygon points are ordered sequentially. 
		 
		The curves are defined via the sindx array. 
		ncurves indicates how many curves make up the polygon. 
		For a given curve i, sindx[i] contains the index of the last 
		point for that curve. 
		That means, the start point of a curve is the index of the 
		last point of the previous curve + 1. 
		 
		For example a polygon with 2 holes and 4 points per curve would look like this : 
		 
		poly_pts :					sindx :				ncurves :	3 
		0)	[ x, y ]				0)	[ 3] 
		1)	[ x, y ]				1)	[ 7] 
		2)	[ x, y ]				2)	[11] 
		3)	[ x, y ] 
		4)	[ x, y ] 
		5)	[ x, y ] 
		6)	[ x, y ] 
		7)	[ x, y ] 
		8)	[ x, y ] 
		9)	[ x, y ] 
		10)	[ x, y ] 
		11)	[ x, y ] 
		 
		Optionally, the line equations of the polygon edges can be passed in. 
		If this routine is called multiple times, for example, 
		clipping many lines against the same polygon, it is more efficient 
		to precompute the line equations and reuse them each time. 
		If this routine is called only once, the line equations array may be passed as NULL. 
		The line equations array is parallel to the points array, with a line 
		equation for each point, defining the edge from this point to the next point. 
		 
		The clipping result is returned in two arrays. 
		They must be preallocated by the calling routine and must be at least 
		as large as the points array + 1 (i.e. sindx[ncurves-1] + 2). 
		 
		clip_lines_start and clip_lines_end are arrays with the start and end points (respectively) 
		of the clipped line fragments. 
		 
		in_out is a marker array which specifies whether a clipped line segment is 
		outside the polygon (-1), on the polygon edge (0), or inside the polygon (1). 
		It contains (n_int_pts - 1) entries. 
		 
		n_clip_lines specifies how many clipped line fragments there are. 
		Note : n_int_pts is always at least 1. 
		If it is, clip_lines contains the original line segment.

	Parameters
		line_start  [Input]
			start point of 2d line segment to clip
		line_end  [Input]
			end point of 2d line segment to clip
		poly_pts  [Input]
			polygon points array
		sindx  [Input]
			array containing the index of the last point for a curve
		ncurves  [Input]
			number of curves in polygon
		edge_equs_a  [Input, Optional]
			array containing the slopes of the line equations of the polygon
			Default Value: the line equations are calculated from the poly_pts array
		edge_equs_c  [Input, Optional]
			array containing the offsets of the line equations of the polygon
			Default Value: the line equations are calculated from the poly_pts array
		clip_lines_start  [Result]
			array of the start points of the clipped line fragments 
			must be preallocated to store sindx[ncurves-1] + 2 values
		clip_lines_end  [Result]
			array of the end points of the clipped line fragments 
			must be preallocated to store sindx[ncurves-1] + 2 values
		in_out  [Result]
			array indicating the location of the 
			clipped line segment in relation to the polygon 
			must be preallocated to store sindx[ncurves-1] + 2 values
		n_clip_lines  [Result]
			number of clipped line fragments

	Returns
		Error codes 
		FZ_MATH_ERR_ZERO_LEN_VEC	- input line is zero length or 
		one of the polygon edges is zero length


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl

	See Also
		fz_math_2d_is_pt_in_polygon,fz_math_2d_cog_of_polygon, 
		fz_math_2d_area_of_polygon,fz_math_2d_filter_polygon_pts

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_2d_clip_line_seg_with_polygon_func)(
	fz_xy_td			*line_start,
	fz_xy_td			*line_end,
	fz_xy_td			*poly_pts,
	fzrt_int			*sindx,
	fzrt_int			ncurves,
	double			*edge_equs_a,
	double			*edge_equs_c,
	fz_xy_td			*clip_lines_start,
	fz_xy_td			*clip_lines_end,
	fzrt_int			*in_out,
	fzrt_int			*n_clip_lines
	);

/****************************************************************

	fz_math_2d_clip_polygon_with_polygon



	Description
		Clips a polygon with a polygon. 
		The polygon is defined as a set of curves. 
		The first curve is the outer boundary. 
		All other curves are assmued to be holes. 
		 
		The polygon points are ordered sequentially. 
		 
		The curves are defined via the sindx array. 
		ncurves indicates how many curves make up the polygon. 
		For a given curve i, sindx[i] contains the index of the last 
		point for that curve. 
		That means, the start point of a curve is the index of the 
		last point of the previous curve + 1. 
		 
		For example a polygon with 2 holes and 4 points per curve would look like this : 
		 
		poly_pts :					sindx :				ncurves :	3 
		0)	[ x, y ]				0)	[ 3] 
		1)	[ x, y ]				1)	[ 7] 
		2)	[ x, y ]				2)	[11] 
		3)	[ x, y ] 
		4)	[ x, y ] 
		5)	[ x, y ] 
		6)	[ x, y ] 
		7)	[ x, y ] 
		8)	[ x, y ] 
		9)	[ x, y ] 
		10)	[ x, y ] 
		11)	[ x, y ] 
		 
		Optionally, the line equations of the polygon edges can be passed in. 
		If this routine is called multiple times, for example, 
		clipping many polygons against the same polygon, it is more efficient 
		to precompute the line equations and reuse them each time. 
		If this routine is called only once, the line equations array may be passed as NULL. 
		The line equations array is parallel to the points array, with a line 
		equation for each point, defining the edge from this point to the next point. 
		 
		The clipping result is returned in two lists, that must be initialised by the calling 
		routine using fz_type_list_init. The clippee_pts_list contains the points and the 
		clippee_curves_list contains the last indices of points in each curve.

	Parameters
		clipper_pts  [Input]
			array of points of the polygon used to clip
		n_clipper_pts  [Input]
			number of points of the polygon used to clip
		clipper_a  [Input, Optional]
			array containing the slopes of the line equations of the polygon
			Default Value: the line equations are calculated from the poly_pts array
		clipper_c  [Input, Optional]
			array containing the offsets of the line equations of the polygon
			Default Value: the line equations are calculated from the poly_pts array
		clippee_pts  [Input]
			array of points of the polygon to clip
		n_clippee_pts  [Input]
			number of points of the polygon to clip
		clippee_a  [Input, Optional]
			array containing the slopes of the line equations of the polygon
			Default Value: the line equations are calculated from the poly_pts array
		clippee_c  [Input, Optional]
			array containing the offsets of the line equations of the polygon
			Default Value: the line equations are calculated from the poly_pts array
		clippee_loops  [Input]
			array containing the index of the last point for a curve
		n_clippee_loops  [Input]
			number of curves in the polygon to clip
		clippee_pts_list  [Result]
			List of clipped points
		clippee_loops_list  [Result]
			List of clipped loops

	Returns
		Error codes 
		FZ_MATH_ERR_ZERO_LEN_VEC	- one of the polygon edges is zero length


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl

	See Also
		fz_type_list_init,fz_type_list_count,fz_math_2d_clip_line_seg_with_polygon, 
		fz_math_2d_is_pt_in_polygon,fz_math_2d_cog_of_polygon, 
		fz_math_2d_area_of_polygon,fz_math_2d_filter_polygon_pts

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_2d_clip_polygon_with_polygon_func)(
	fz_xy_td			*clipper_pts,
	fzrt_int				n_clipper_pts,
	double				*clipper_a,
	double				*clipper_c,
	fz_xy_td			*clippee_pts,
	fzrt_int				n_clippee_pts,
	double				*clippee_a,
	double				*clippee_c,
	fzrt_int				*clippee_loops,
	fzrt_int				n_clippee_loops,
	fz_type_list_ptr 	clippee_pts_list,
	fz_type_list_ptr 	clippee_loops_list
	);

/****************************************************************

	fz_math_2d_cog_of_polygon



	Description
		Finds the center of gravity for a polygon. 
		The polygon is defined by the 2d points in the pts array. 
		npts indicates how many 2d points are in the polygon, as passed in pts.

	Parameters
		pts  [Input]
			polygon points array
		npts  [Input]
			number of 2d points in the polygon
		center  [Result]
			center of the polygon

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl

	See Also
		fz_math_2d_is_pt_in_polygon,fz_math_2d_clip_line_seg_with_polygon, 
		fz_math_2d_area_of_polygon,fz_math_2d_filter_polygon_pts, 
		fz_math_3d_cog_of_polygon

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_2d_cog_of_polygon_func) (
	fz_xy_td	*pts,
	fzrt_int	npts,
	fz_xy_td	*center
	);

/****************************************************************

	fz_math_2d_area_of_polygon



	Description
		Finds the area for a polygon. 
		The polygon is defined by the points in the pts array. 
		npts indicates how many 2d points are in the polygon, as passed in pts. 
		If the polygon is defined in counterclockwise direction, 
		the area is negative, otherwise it is positive.

	Parameters
		pts  [Input]
			polygon points array
		npts  [Input]
			number of 2d points in the polygon
		area  [Result]
			area of the polygon

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl

	See Also
		fz_math_2d_is_pt_in_polygon,fz_math_2d_clip_line_seg_with_polygon, 
		fz_math_2d_cog_of_polygon,fz_math_2d_filter_polygon_pts

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_2d_area_of_polygon_func) (
	fz_xy_td	*pts,
	fzrt_int	npts,
	double	*area
	);

/****************************************************************

	fz_math_2d_filter_polygon_pts



	Description
		Filters duplicate polygon points. 
		The polygon is defined by the 2d points in the pts array. 
		npts indicates how many 2d points are in the polygon, as passed in pts. 
		Returns the new number of points in the npts argument.

	Parameters
		pts  [Input]
			polygon points array
		npts  [Input, Result]
			in : number of 2d points in the polygon 
			out : number of non-duplicate 2d points in the polygon
		closed  [Input]
			is the polygon closed

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl

	See Also
		fz_math_2d_is_pt_in_polygon,fz_math_2d_clip_line_seg_with_polygon, 
		fz_math_2d_cog_of_polygon,fz_math_2d_area_of_polygon, 
		fz_math_3d_filter_polygon_pts

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_2d_filter_polygon_pts_func) (
	fz_xy_td			*pts,
	fzrt_int			*npts,
	fzrt_boolean	closed
	);

/****************************************************************

	fz_math_2d_xy_mm_to_pnts



	Description
		Converts a fz_xy_mm_td into an array of 4 fz_xy_td representing 
		the corners of the bounding box. The pnts array passed in must be 
		allocated by the calling function to at least 4 items.

	Parameters
		bbox  [Input]
			the bounding box
		pnts  [Result]
			the 4 points representing the corners of the box. The pnts 
			array must be allocated by the calling function to at 
			least 4 items.

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_2d.fsl
 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_2d_xy_mm_to_pnts_func) (
	fz_xy_mm_td 			*bbox,
	fz_xy_td 				*pnts
	);

/****************************************************************

	fz_math_3d_is_zero_len_vec



	Description
		Checks whether a 3d vector is zero length.

	Parameters
		vec  [Input]
			3d vector to be checked

	Returns
		TRUE if zero length, FALSE otherwise


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_3d_is_unit_len_vec,fz_math_2d_is_zero_len_vec

 ****************************************************************/
typedef fzrt_boolean	 (*fz_math_3d_is_zero_len_vec_func)(
	fz_xyz_td			*vec
	);

/****************************************************************

	fz_math_3d_is_unit_len_vec



	Description
		Checks whether a 3d vector is unit length 
		(length == 1.0).

	Parameters
		vec  [Input]
			3d vector to be checked

	Returns
		TRUE if unit length, FALSE otherwise


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_3d_is_zero_len_vec,fz_math_2d_is_unit_len_vec

 ****************************************************************/
typedef fzrt_boolean	 (*fz_math_3d_is_unit_len_vec_func)(
	fz_xyz_td			*vec
	);

/****************************************************************

	fz_math_3d_is_pt_between_pts



	Description
		Checks whether a 3d point is between two other 3d points. 
		The largest projection of the line is used to establish "between".

	Parameters
		p1  [Input]
			3d point 1 to check against
		p2  [Input]
			3d point 2 to check against
		pt  [Input]
			3d point to be checked

	Returns
		TRUE if point is between, FALSE otherwise


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_2d_is_pt_between_pts

 ****************************************************************/
typedef fzrt_boolean	 (*fz_math_3d_is_pt_between_pts_func)(
	fz_xyz_td			*p1,
	fz_xyz_td			*p2,
	fz_xyz_td			*pt
	);

/****************************************************************

	fz_math_3d_normalize_vec



	Description
		Given a 3d vector, creates the normalized (unit) 3d vector. 
		Note : vec and unit_vec can be passed as the same pointer.

	Parameters
		vec  [Input]
			3d vector
		unit_vec  [Result]
			normalized 3d vector

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_2d_normalize_vec

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_normalize_vec_func)(
	fz_xyz_td			*vec,
	fz_xyz_td			*unit_vec
	);

/****************************************************************

	fz_math_3d_cross_prod



	Description
		Given two 3d vectors, returns the cross product as a normalized 3d vector.

	Parameters
		vec1  [Input]
			3d vector 1
		vec2  [Input]
			3d vector 2
		norm  [Result]
			normalized cross product 3d vector

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_2d_perp_vec

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_cross_prod_func)(
	fz_xyz_td			*vec1,
	fz_xyz_td			*vec2,
	fz_xyz_td			*norm
	);

/****************************************************************

	fz_math_3d_vec_rotation_xyz



	Description
		Given two 3d vectors (which must be perpendicular to each other), 
		finds the three rotation angles, which will rotate 
		the world xaxis (1,0,0) and yaxis (0,1,0) into the given vectors. 
		The angles must be applied in z x y order. 
		Likewise when the angles are applied in y x z order to the given vectors, 
		they result as the xaxis and yaxis. 
		This is the inverse function of fz_math_3d_xyz_rotation_vec.

	Parameters
		xaxis  [Input]
			x axis (must be perpendicular to yaxis)
		yaxis  [Input]
			y axis (must be perpendicular to xaxis)
		angles  [Result]
			rotation angles

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_3d_xyz_rotation_vec

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_vec_rotation_xyz_func)(
	fz_xyz_td			*xaxis,
	fz_xyz_td			*yaxis,
	fz_xyz_td			*angles
	);

/****************************************************************

	fz_math_3d_xyz_rotation_vec



	Description
		Given three rotation angles (in z,y,x order), finds two 3d vectors 
		which represent the world xaxis and y axis rotated by the 
		three rotation angles. 
		This is the inverse function of fz_math_3d_vec_rotation_xyz.

	Parameters
		angles  [Input]
			rotation angles
		xaxis  [Result]
			x axis
		yaxis  [Result]
			y axis

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_3d_vec_rotation_xyz

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_xyz_rotation_vec_func) (
	fz_xyz_td			*angles,
	fz_xyz_td			*xaxis,
	fz_xyz_td			*yaxis
	);

/****************************************************************

	fz_math_3d_project_pt_on_line



	Description
		Given a 3d line segment (defined by it's start and end points), 
		finds the 3d point on the line segment that is perpendicular to a given 3d point. 
		Optionally, returned can be : 
		line_pt : the actual perpendicular point 
		dist 	: the distance (dist_squared == FALSE) or squared distance (dist_squared == TRUE) 
		of the original point from the line 
		kase 	: bit encoded, where the point lies with respect to the two line points 
		0x00000000		line_pt in not between line_start and line_end 
		0x00000001		line_pt is on line_start 
		0x00000002		line_pt is on line_end 
		0x00000004		line_pt is between line_start and line_end

	Parameters
		line_start  [Input]
			start point of 3d line segment
		line_end  [Input]
			end point of 3d line segment
		pt  [Input]
			original 3d point
		dist_squared  [Input]
			Is the returned distance squared
		line_pt  [Result, Optional]
			3d point perpendicular to the original point
		dist  [Result, Optional]
			distance of the original point to the line 
			(squared distance if dist_squared is TRUE)
		kase  [Result, Optional]
			where the perpendicular point lies 
			with respect to the two line points

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_2d_project_pt_on_line_seg

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_project_pt_on_line_func)(
	fz_xyz_td			*line_start,
	fz_xyz_td			*line_end,
	fz_xyz_td			*pt,
	fzrt_boolean	dist_squared,
	fz_xyz_td			*line_pt,
	double			*dist,
	fzrt_int			*kase
	);

/****************************************************************

	fz_math_3d_rot_pt_around_line



	Description
		Rotates a 3d point around a 3d line segment (defined by it's start and end points) by an angle. 
		Note : pt and rot_pt can be passed as the same pointer.

	Parameters
		line_start  [Input]
			start point of 3d line segment to  point about
		line_end  [Input]
			end point of 3d line segment to rotate point about
		pt  [Input]
			3d point to rotate about line
		angle  [Input]
			angle to rotate the point
		rot_pt  [Result]
			rotated 3d point

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_3d_rot_pt_around_axis

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_rot_pt_around_line_func)(
	fz_xyz_td			*line_start,
	fz_xyz_td			*line_end,
	fz_xyz_td			*pt,
	double			angle,
	fz_xyz_td			*rot_pt
	);

/****************************************************************

	fz_math_3d_colinear_3_pts_tol



	Description
		Given three 3d points, determines if they are colinear, using an 
		angle to define "colinear". 
		For speedup purpose, the angle passed in is expressed as the 
		cosine of the actual angle. 
		An appropriate angle is 0.1 degree for example.

	Parameters
		p1  [Input]
			3d point 1
		p2  [Input]
			3d point 2
		p3  [Input]
			3d point 3
		cos_angle  [Input]
			cosine of the angle used to define colinear
		is_colinear  [Result]
			TRUE if the points are colinear, 
			FALSE otherwise

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_3d_colinear_3_pts, 
		fz_math_2d_colinear_3_pts_tol

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_colinear_3_pts_tol_func)(
	fz_xyz_td			*p1,
	fz_xyz_td			*p2,
	fz_xyz_td			*p3,
	double			cos_angle,
	fzrt_boolean	*is_colinear
	);

/****************************************************************

	fz_math_3d_colinear_3_pts



	Description
		Given three 3d points, determines if they are colinear. 
		This function uses a system defined tolerance to determine colinearity.

	Parameters
		p1  [Input]
			3d point 1
		p2  [Input]
			3d point 2
		p3  [Input]
			3d point 3
		is_colinear  [Result]
			TRUE if the points are colinear, 
			FALSE otherwise

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_3d_colinear_3_pts_tol, 
		fz_math_2d_colinear_3_pts

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_colinear_3_pts_func)(
	fz_xyz_td			*p1,
	fz_xyz_td			*p2,
	fz_xyz_td			*p3,
	fzrt_boolean	*is_colinear
	);

/****************************************************************

	fz_math_3d_isect_line_plane



	Description
		Finds the intersection point of a 3d line (defined by it's slope and offset) with a plane.

	Parameters
		line_start  [Input]
			start point of 3d line segment
		line_end  [Input]
			end point of 3d line segment
		equ  [Input]
			plane
		int_pt  [Result]
			3d intersection point

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_3d_isect_line_cube,fz_math_3d_isect_line_sphere,fz_math_3d_isect_lines, 
		fz_math_3d_isect_3_planes,fz_math_3d_isect_2_planes

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_isect_line_plane_func)(
	fz_xyz_td			*line_start,
	fz_xyz_td			*line_end,
	fz_plane_equ_td			*equ,
	fz_xyz_td			*int_pt
	);

/****************************************************************

	fz_math_3d_is_parl_lines



	Description
		Checks whether two 3d line segments (defined by it's start and end points) are parallel.

	Parameters
		line1_start  [Input]
			start point of 3d line segment 1
		line1_end  [Input]
			end point of 3d line segment 1
		line2_start  [Input]
			start point of 3d line segment 2
		line2_end  [Input]
			end point of 3d line segment 2

	Returns
		TRUE if parallel, FALSE if not or at least one of the lines is zero length


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_2d_is_parl_line_segs

 ****************************************************************/
typedef fzrt_boolean	 (*fz_math_3d_is_parl_lines_func)(
	fz_xyz_td 	*line1_start,
	fz_xyz_td 	*line1_end,
	fz_xyz_td 	*line2_start,
	fz_xyz_td 	*line2_end
	);

/****************************************************************

	fz_math_3d_isect_lines



	Description
		Calculates the 3d intersection point of two line segments 
		(defined by their start and end points) in 3D. 
		The int_kase result indicates how the line segments intersect, if no error occurred. 
		If an error occurred, int_kase is always set to 0x00000000. 
		The cases are bit encoded as follows : 
		 
		bit 0 == 0 lines don't intersect, only their extensions do. Or an error occurred. 
		bit 0 == 1 a true intersection occurred (intersection point is on either line. 
		i.e. segment check) 
		 
		Details about the intersection : 
		 
		0x00000002 int_pt is on line1_start 
		0x00000004 int_pt is on line1_end 
		0x00000008 int_pt is between line1_start and line1_end 
		0x00000010 int_pt is on line2_start 
		0x00000020 int_pt is on line2_end 
		0x00000040 int_pt is between line2_start and line2_end

	Parameters
		line1_start  [Input]
			start point of 3d line segment 1
		line1_end  [Input]
			end point of 3d line segment 1
		line2_start  [Input]
			start point of 3d line segment 2
		line2_end  [Input]
			end point of 3d line segment 2
		int_pt  [Result]
			3d intersection point
		int_kase  [Result, Optional]
			how the line segments interact

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_3d_isect_line_plane,fz_math_3d_isect_line_cube,fz_math_3d_isect_line_sphere, 
		fz_math_3d_isect_3_planes,fz_math_3d_isect_2_planes, 
		fz_math_2d_isect_line_segs,fz_math_2d_isect_line_equs

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_isect_lines_func)(
	fz_xyz_td 	*line1_start,
	fz_xyz_td 	*line1_end,
	fz_xyz_td 	*line2_start,
	fz_xyz_td 	*line2_end,
	fz_xyz_td	*int_pt,
	fzrt_int	*int_kase
	);

/****************************************************************

	fz_math_3d_volume_of_tetrahedron



	Description
		Calculates the volume of a tetrahedron. 
		The tetrahedron is defined by four points. 
		p1, p2 and p3 form the base triangle and top is the tip. 
		A negative volume is returned if the top of the tetrahedron is on the negative side 
		(right hand rule) of the base triangle formed by p1,p2 and p3.

	Parameters
		p1  [Input]
			base 3d point 1
		p2  [Input]
			base 3d point 2
		p3  [Input]
			base 3d point 3
		top  [Input]
			tip point

	Returns
		volume of tetrahedron


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl
 ****************************************************************/
typedef double	 (*fz_math_3d_volume_of_tetrahedron_func)(
	fz_xyz_td			*p1,
	fz_xyz_td			*p2,
	fz_xyz_td			*p3,
	fz_xyz_td			*top
	);

/****************************************************************

	fz_math_3d_equ_from_3_pts



	Description
		Calculates the equation of the plane defined by the three 3d points. 
		The normal direction of the plane is derived from the right hand 
		rule of vectors p2p1 and p2p3 (i.e. p2p1 x p2p3 = norm dir of plane).

	Parameters
		p1  [Input]
			plane 3d point 1
		p2  [Input]
			plane 3d point 2
		p3  [Input]
			plane 3d point 3
		equ  [Result]
			plane equation

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl
 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_equ_from_3_pts_func)(
	fz_xyz_td			*p1,
	fz_xyz_td			*p2,
	fz_xyz_td			*p3,
	fz_plane_equ_td			*equ
	);

/****************************************************************

	fz_math_3d_dir_of_3_pts



	Description
		Given three 3d points and a projection plane, determines whether 
		the three points are in clockwise order, counterclockwise order 
		or colinear / equal when projected on that plane.

	Parameters
		p1  [Input]
			3d point 1
		p2  [Input]
			3d point 2
		p3  [Input]
			3d point 3
		proj_plane  [Input]
			projection plane

	Returns
		1 if clockwise, 
		1 if counter clockwise, 
		0 if colinear or at least two points are equal


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl
 ****************************************************************/
typedef fzrt_int	 (*fz_math_3d_dir_of_3_pts_func)(
	fz_xyz_td				*p1,
	fz_xyz_td				*p2,
	fz_xyz_td				*p3,
	fz_plane_enum		proj_plane
	);

/****************************************************************

	fz_math_3d_equal_equs



	Description
		Checks if two planes are coplanar or reversely coplanar.

	Parameters
		e1  [Input]
			plane 1
		e2  [Input]
			plane 2

	Returns
		1 if coplanar, 
		2 if reversely coplanar, 
		0 if not coplanar


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl
 ****************************************************************/
typedef fzrt_int	 (*fz_math_3d_equal_equs_func)(
	fz_plane_equ_td			*e1,
	fz_plane_equ_td			*e2
	);

/****************************************************************

	fz_math_3d_is_parl_equs



	Description
		Checks if two planes are parallel or reversely parallel.

	Parameters
		e1  [Input]
			plane 1
		e2  [Input]
			plane 2

	Returns
		TRUE if parallel or reversely parallel, FALSE otherwise


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl
 ****************************************************************/
typedef fzrt_boolean	 (*fz_math_3d_is_parl_equs_func)(
	fz_plane_equ_td 		*e1,
	fz_plane_equ_td 		*e2
	);

/****************************************************************

	fz_math_3d_get_proj_plane



	Description
		Given a plane equation, gets the largest of the three projection planes.

	Parameters
		equ  [Input]
			plane

	Returns
		FZ_PLANE_XY, FZ_PLANE_YZ or FZ_PLANE_ZX


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl
 ****************************************************************/
typedef fz_plane_enum	 (*fz_math_3d_get_proj_plane_func)(
	fz_plane_equ_td 		*equ
	);

/****************************************************************

	fz_math_3d_pt_in_proj_plane



	Description
		Given a 3d point and a projection plane, returns a new 3d point, whose 
		x, y and z coordinates are expressed in the local coordinate system 
		of the projection plane.

	Parameters
		pt_in  [Input]
			3d point
		proj_plane  [Input]
			projection plane
		pt_out  [Result]
			3d point expressed in local coordinate 
			system of the projection plane

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl
 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_pt_in_proj_plane_func)(
	fz_xyz_td				*pt_in,
	fz_plane_enum		proj_plane,
	fz_xyz_td				*pt_out
	);

/****************************************************************

	fz_math_3d_is_pt_on_line



	Description
		Given a 3d line segment (defined by it's start and end points) and a 3d point, 
		determines whether the point is on that line. 
		The line is assumed to extend infinitely.

	Parameters
		line_start  [Input]
			start point of 3d line segment
		line_end  [Input]
			end point of 3dline segment
		pt  [Input]
			3d point

	Returns
		TRUE if point is on the line (within a tolerance), FALSE otherwise


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_2d_is_pt_on_line_equ

 ****************************************************************/
typedef fzrt_boolean	 (*fz_math_3d_is_pt_on_line_func)(
	fz_xyz_td			*line_start,
	fz_xyz_td			*line_end,
	fz_xyz_td			*pt
	);

/****************************************************************

	fz_math_3d_isect_3_planes



	Description
		Calculates the 3d intersection point of three planes.

	Parameters
		plane1  [Input]
			plane 1
		plane2  [Input]
			plane 2
		plane3  [Input]
			plane 3
		int_pt  [Result]
			3d intesection point

	Returns
		Error codes 
		FZ_MATH_ERR_PLANES_PARALLEL	all three plane normals are contained in one plane 
		(i.e two or more plane are parallel or the lines of 
		intersection between the planes are parallel)


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_3d_isect_line_plane,fz_math_3d_isect_line_cube,fz_math_3d_isect_line_sphere, 
		fz_math_3d_isect_lines,fz_math_3d_isect_2_planes

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_isect_3_planes_func)(
	fz_plane_equ_td			*plane1,
	fz_plane_equ_td			*plane2,
	fz_plane_equ_td			*plane3,
	fz_xyz_td			*int_pt
	);

/****************************************************************

	fz_math_3d_project_pt_on_plane



	Description
		Projects a 3d point perpendicular on a plane. 
		Also returns the distance of the original point from the plane.

	Parameters
		pt_in  [Input]
			3d point to project
		plane  [Input]
			plane to project point on
		pt_out  [Result, Optional]
			3d point projected onto plane
		dist  [Result, Optional]
			distance of original point from the plane

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl
 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_project_pt_on_plane_func)(
	fz_xyz_td			*pt_in,
	fz_plane_equ_td			*plane,
	fz_xyz_td			*pt_out,
	double			*dist
	);

/****************************************************************

	fz_math_3d_isect_2_planes



	Description
		Calculates the 3d intersection line segment (defined by it's start and end points) of two planes. 
		Note : the start and end points of the line segment are chosen arbitrarily.

	Parameters
		plane1  [Input]
			plane 1
		plane2  [Input]
			plane 2
		int_line_start  [Result]
			start point of 3d line segment
		int_line_end  [Result]
			end point of 3d line segment

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_3d_isect_line_plane,fz_math_3d_isect_line_cube,fz_math_3d_isect_line_sphere, 
		fz_math_3d_isect_lines,fz_math_3d_isect_3_planes

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_isect_2_planes_func)(
	fz_plane_equ_td			*plane1,
	fz_plane_equ_td			*plane2,
	fz_xyz_td			*int_line_start,
	fz_xyz_td			*int_line_end
	);

/****************************************************************

	fz_math_3d_dist_2_lines



	Description
		Calculates the shortest distance between two 3d lines in 3d space. 
		The two 3d points, where the shortest distance occurs are also returned 
		(pt1 on line 1 and pt2 on line 2). 
		If the two lines lie in the same plane pt1 and pt2 are the same. 
		If the two lines are parallel, pt1 is line1_start and pt2 is 
		the perpendicular projection of pt1 on line 2. 
		How the two lines relate in 3d is returned in the kase parameter. 
		0 : lines don't intersect in one point and are not parallel 
		1 : lines intersect in one point and are not parallel (i.e. dist = 0.0 and pt1 == pt2) 
		2 : lines are parallel (dist is constant between the lines, pt1 and pt2 chosen arbitrarily)

	Parameters
		line1_start  [Input]
			start point of 3d line segment 1
		line1_end  [Input]
			end point of 3d line segment 1
		line2_start  [Input]
			start point of 3d line segment 2
		line2_end  [Input]
			end point of 3d line segment 2
		dist  [Result, Optional]
			shortest distance between the lines
		pt1  [Result, Optional]
			3d point on line segment 1 where the 
			shortest distance occurs
		pt2  [Result, Optional]
			3d point on line segment 2 where the 
			shortest distance occurs
		kase  [Result, Optional]
			how the line segments relate

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl
 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_dist_2_lines_func)(
	fz_xyz_td			*line1_start,
	fz_xyz_td			*line1_end,
	fz_xyz_td			*line2_start,
	fz_xyz_td			*line2_end,
	double			*dist,
	fz_xyz_td			*pt1,
	fz_xyz_td			*pt2,
	fzrt_int			*kase
	);

/****************************************************************

	fz_math_3d_dist_pt_line



	Description
		Calculates the perpendicular distance between a 3d point and a 
		3d line segment (defined by it's start and end points).

	Parameters
		line_start  [Input]
			start point of 3d line segment
		line_end  [Input]
			end point of 3d line segment
		pt  [Input]
			3d point
		dist  [Result]
			distance between line and point

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		FZ_MATH_3D_DIST_PT_PLANE, 
		fz_math_2d_dist_pt_line_seg

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_dist_pt_line_func)(
	fz_xyz_td			*line_start,
	fz_xyz_td			*line_end,
	fz_xyz_td			*pt,
	double			*dist
	);

/****************************************************************

	fz_math_3d_bisect_angle



	Description
		Calculates the 3d bisect vector of an angle defined by three 3d points 
		(pt1, center, pt2). 
		center is the apex of the angle formed by the 3d vectors (center, pt1) and 
		(center, pt2).

	Parameters
		pt1  [Input]
			3d point 1
		center  [Input]
			apex of the angle
		pt2  [Input]
			3d point 2
		bisect_vec  [Result]
			3d bisect vector

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_2d_bisect_angle

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_bisect_angle_func)(
	fz_xyz_td			*pt1,
	fz_xyz_td			*center,
	fz_xyz_td			*pt2,
	fz_xyz_td			*bisect_vec
	);

/****************************************************************

	fz_math_3d_interp_pt_on_line



	Description
		Given a 3d line segment (defined by it's start and end points) 
		and a ratio (between 0.0 and 1.0), 
		interpolates a 3d point on the line segment. 
		For example: 
		ratio 0.0 : point is at line_start 
		ratio 0.5 : point is the midpoint of the line segment 
		ratio 1.0 : point is at line_end

	Parameters
		line_start  [Input]
			start point of 3d line segment
		line_end  [Input]
			ens point of 3d line segment
		ratio  [Input]
			ratio
			Range: 0.0
		pt  [Result]
			interpolated 3d point

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_2d_interp_pt_on_line

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_interp_pt_on_line_func)(
	fz_xyz_td			*line_start,
	fz_xyz_td			*line_end,
	double			ratio,
	fz_xyz_td			*pt
	);

/****************************************************************

	fz_math_3d_angle_of_2_lines



	Description
		Given an angle defined by three 3d points (pt1, center, pt2), 
		calculates the angle in radians. 
		center is the apex of the angle formed by the 3d vectors (center, pt1) and 
		(center, pt2).

	Parameters
		pt1  [Input]
			3d point 1
		center  [Input]
			apex of the angle
		pt2  [Input]
			3d point 2
		angle  [Result]
			angle in radians

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_2d_angle_of_2_lines

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_angle_of_2_lines_func)(
	fz_xyz_td			*pt1,
	fz_xyz_td			*center,
	fz_xyz_td			*pt2,
	double			*angle
	);

/****************************************************************

	fz_math_3d_reflect_pt_about_pt



	Description
		Reflects a 3d point (pt_in) about another 3d point (center).

	Parameters
		pt_in  [Input]
			3d point to reflect
		center  [Input]
			3d point to reflect about
		pt_out  [Result]
			reflected 3d point

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_3d_reflect_pt_about_line,fz_math_3d_reflect_pt_about_plane, 
		fz_math_2d_reflect_pt_about_pt

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_reflect_pt_about_pt_func)(
	fz_xyz_td			*pt_in,
	fz_xyz_td			*center,
	fz_xyz_td			*pt_out
	);

/****************************************************************

	fz_math_3d_reflect_pt_about_line



	Description
		Reflects a 3d point (pt_in) about a 3d line segment (defined by it's start and end points).

	Parameters
		pt_in  [Input]
			3d point to reflect
		line_start  [Input]
			start point of 3d line segment to reflect about
		line_end  [Input]
			end point of 3d line segment to reflect about
		pt_out  [Result]
			reflected 3d point

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_3d_reflect_pt_about_pt,fz_math_3d_reflect_pt_about_plane, 
		fz_math_2d_reflect_pt_about_line

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_reflect_pt_about_line_func)(
	fz_xyz_td			*pt_in,
	fz_xyz_td			*line_start,
	fz_xyz_td			*line_end,
	fz_xyz_td			*pt_out
	);

/****************************************************************

	fz_math_3d_reflect_pt_about_plane



	Description
		Reflects a 3d point (pt_in) about a plane (plane).

	Parameters
		pt_in  [Input]
			3d point to reflect
		plane  [Input]
			plane to reflect about
		pt_out  [Result]
			reflected 3d point

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_3d_reflect_pt_about_pt,fz_math_3d_reflect_pt_about_line,

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_reflect_pt_about_plane_func)(
	fz_xyz_td			*pt_in,
	fz_plane_equ_td			*plane,
	fz_xyz_td			*pt_out
	);

/****************************************************************

	fz_math_3d_create_unit_vec



	Description
		Creates a unit length 3d vector from two 3d points.

	Parameters
		pt1  [Input]
			3d point 1
		pt2  [Input]
			3d point 2
		unit_vec  [Result]
			unit length 3d vector

	Returns
		Error codes 
		FZ_MATH_ERR_ZERO_LEN_VEC - the two 3d points are equal


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_2d_create_unit_vec

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_create_unit_vec_func)(
	fz_xyz_td			*pt1,
	fz_xyz_td			*pt2,
	fz_xyz_td			*unit_vec
	);

/****************************************************************

	fz_math_3d_rot_pt_around_axis



	Description
		Rotates a 3d point around one of the three orthogonal axes. 
		Note : pt and rot_pt can be passed as the same pointer.

	Parameters
		which_axis  [Input]
			axis to rotate point about
		pt  [Input]
			3d point to be rotated
		angle  [Input]
			angle to rotate point about axis
		rot_pt  [Result]
			rotated 3d point

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_3d_rot_pt_around_line

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_rot_pt_around_axis_func)(
	fz_axis_enum	which_axis,
	fz_xyz_td			*pt,
	double			angle,
	fz_xyz_td			*rot_pt
	);

/****************************************************************

	fz_math_3d_area_of_3_pts



	Description
		Calculates the area of a triangle defined by three 3d points. 
		The area is always positive (unlike FZ_MATH_2D_AREA_OF_3_PTS, 
		where the area is negative if the points are ordered counterclockwise)

	Parameters
		pt1  [Input]
			3d point 1
		pt2  [Input]
			3d point 2
		pt3  [Input]
			3d point 3

	Returns
		area of the triangle


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		FZ_MATH_2D_AREA_OF_3_PTS

 ****************************************************************/
typedef double	 (*fz_math_3d_area_of_3_pts_func)(
	fz_xyz_td			*pt1,
	fz_xyz_td			*pt2,
	fz_xyz_td			*pt3
	);

/****************************************************************

	fz_math_3d_get_3rd_pt_on_plane



	Description
		Given a 3d vector and two 3d points, returns a third 3d point, 
		which is on the plane (defined by the normal formed by 
		the cross of the line (p1 to p2) and the vector).

	Parameters
		vec  [Input]
			3d vector
		p1  [Input]
			3d point 1
		p2  [Input]
			3d point 2
		p3  [Result]
			3d point on the plane

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl
 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_get_3rd_pt_on_plane_func)(
	fz_xyz_td			*vec,
	fz_xyz_td			*p1,
	fz_xyz_td			*p2,
	fz_xyz_td			*p3
	);

/****************************************************************

	fz_math_3d_isect_line_sphere



	Description
		Calculates the intersection of a line segment (defined by it's start and end points) 
		with a sphere (defined by a center and radius). 
		Note : int_pts must be an array that can hold two 3d points. 
		n_int_pts wil be returned as either 0, 1 or 2 and indicates how many 
		points are stored in int_pts.

	Parameters
		line_start  [Input]
			start point of 3d line segment
		line_end  [Input]
			end point of 3d line segment
		center  [Input]
			center of the sphere
		radius  [Input]
			radius of the sphere
		int_pts[2]  [Result]
			intersecting 3d points array
		n_int_pts  [Result]
			number of intersecting points

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_3d_isect_line_plane,fz_math_3d_isect_line_cube,fz_math_3d_isect_lines, 
		fz_math_3d_isect_line_cone,fz_math_3d_isect_3_planes,fz_math_3d_isect_2_planes

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_isect_line_sphere_func)(
	fz_xyz_td			*line_start,
	fz_xyz_td			*line_end,
	fz_xyz_td			*center,
	double				radius,
	fz_xyz_td			int_pts[2],
	fzrt_int				*n_int_pts
	);
	
/****************************************************************

	fz_math_3d_isect_line_cone



	Description
		Calculate the intersection of a line with a cone, defined by an apex point, 
		a vector for the cone axis direction and the cone's half angle (angle between 
		its side and the axis) 
		n_int_pts indicates, whether there are 0, 1 or 2 
		intersection points, returned in the int_pts array. Note, that this must 
		be an array that can hold 2 fz_xyz_td.

	Parameters
		line_start  [Input]
			start point of 3d line segment
		line_end  [Input]
			end point of 3d line segment
		cone_apex  [Input]
			apex (tip) of the cone
		cone_axis_vector  [Input]
			axis direction of the cone (normalized)
		cone_angle  [Input]
			the cone's half angle
		int_pts[2]  [Result]
			intersecting 3d points array
		n_int_pts  [Result]
			number of intersecting points

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_3d_isect_line_plane,fz_math_3d_isect_line_cube,fz_math_3d_isect_lines, 
		fz_math_3d_isect_line_sphere,fz_math_3d_isect_3_planes,fz_math_3d_isect_2_planes, 
		fz_math_3d_isect_line_cyln

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_isect_line_cone_func)(
	fz_xyz_td			*line_start,
	fz_xyz_td			*line_end,
	fz_xyz_td			*cone_apex,
	fz_xyz_td			*cone_axis_vector,
	double				cone_angle,
	fz_xyz_td			int_pts[2],
	fzrt_int				*n_int_pts
	);

/****************************************************************

	fz_math_3d_isect_line_cyln



	Description
		Calculate the intersection of a line with a cylinder, defined by an origin point, 
		a vector for the cylinder axis direction and the cylinder's radius. 
		n_int_pts indicates, whether there are 0, 1 or 2 
		intersection points, returned in the int_pts array. Note, that this must 
		be an array that can hold 2 fz_xyz_td.

	Parameters
		line_start  [Input]
			start point of 3d line segment
		line_end  [Input]
			end point of 3d line segment
		cyln_org  [Input]
			origin (center) of the cylinder
		cyln_axis_vector  [Input]
			axis direction of the cylinder (normalized)
		radius  [Input]
			the cylinfer radius
		int_pts[2]  [Result]
			intersecting 3d points array
		n_int_pts  [Result]
			number of intersecting points

	Returns
		Error codes


	Availability	7.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_3d_isect_line_plane,fz_math_3d_isect_line_cube,fz_math_3d_isect_lines, 
		fz_math_3d_isect_line_sphere,fz_math_3d_isect_3_planes,fz_math_3d_isect_2_planes, 
		fz_math_3d_isect_line_cone

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_isect_line_cyln_func)(
	fz_xyz_td			*line_start,
	fz_xyz_td			*line_end,
	fz_xyz_td			*cyln_org,
	fz_xyz_td			*cyln_axis_vector,
	double				radius,
	fz_xyz_td			int_pts[2],
	fzrt_int				*n_int_pts
	);

/****************************************************************

	fz_math_3d_isect_line_cube



	Description
		Calculates the intersection of a 3d line with an axis aligned cube, 
		defined by two opposite corners. 
		Note : int_pts must be an array that can hold 2 points. 
		n_int_pts wil be returned as either 0, 1 or 2 and indicates how many 
		points are stored in int_pts.

	Parameters
		line_start  [Input]
			start point of 3d line segment
		line_end  [Input]
			end point of 3d line segment
		pt1  [Input]
			corner of cube
		pt2  [Input]
			opposite corner of cube
		int_pts[2]  [Result]
			intersecting 3d points array
		n_int_pts  [Result]
			number of intersecting points

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_3d_isect_line_plane,fz_math_3d_isect_line_sphere,fz_math_3d_isect_lines, 
		fz_math_3d_isect_3_planes,fz_math_3d_isect_2_planes

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_isect_line_cube_func)(
	fz_xyz_td			*line_start,
	fz_xyz_td			*line_end,
	fz_xyz_td			*pt1,
	fz_xyz_td			*pt2,
	fz_xyz_td			int_pts[2],
	fzrt_int			*n_int_pts
	);

/****************************************************************

	fz_math_3d_cog_of_polygon



	Description
		Finds the center of gravity for a polygon. 
		The polygon is defined by the 3d points in the pts array. 
		npts indicates how many 3d points are in the polygon, as passed in pts.

	Parameters
		pts  [Input]
			polygon points array
		npts  [Input]
			number of 3d points in polygon
		center  [Result]
			center of gravity of polygon

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_3d_normal_of_polygon,fz_math_3d_filter_polygon_pts, 
		fz_math_2d_cog_of_polygon

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_cog_of_polygon_func) (
	fz_xyz_td	*pts,
	fzrt_int	npts,
	fz_xyz_td	*center
	);

/****************************************************************

	fz_math_3d_normal_of_polygon



	Description
		Finds the normal vector for a polygon. 
		The polygon is defined by the 3d points in the pts array. 
		npts indicates how many 3d points are in the polygon, as passed in pts. 
		The result is only accurate if the 3d polygon is planar.

	Parameters
		pts  [Input]
			polygon points array
		npts  [Input]
			number of 3d points in polygon
		norm  [Result]
			normal vector

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_3d_cog_of_polygon,fz_math_3d_filter_polygon_pts

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_normal_of_polygon_func) (
	fz_xyz_td		*pts,
	fzrt_int		npts,
	fz_xyz_td		*norm
	);

/****************************************************************

	fz_math_3d_filter_polygon_pts



	Description
		Filters duplicate polygon points. 
		The polygon is defined by the 3d points in the pts array. 
		npts indicates how many 3d points are in the polygon, as passed in pts. 
		Returns the new number of points in the npts argument.

	Parameters
		pts  [Input]
			polygon points array
		npts  [Input, Result]
			in : number of points in the polygon 
			out : number of non-duplicate points in the polygon
		closed  [Input]
			is the polygon closed

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_3d_cog_of_polygon,fz_math_3d_normal_of_polygon, 
		fz_math_2d_filter_polygon_pts

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_filter_polygon_pts_func) (
	fz_xyz_td			*pts,
	fzrt_int			*npts,
	fzrt_boolean	closed
	);

/****************************************************************

	fz_math_3d_map_plane_from_pts



	Description
		Defines a map plane from 3 points. The first point is a point on the 
		x axis of the map plane. The second point is the plane's origin. The 
		third point is a point on the y axis of the map plane. The three points 
		cannot be coincident and cannot be colinear. The origin->yaxis_pt vector does not 
		necessarily have to be perpendicular to the origin->xaxis_pt vector.

	Parameters
		xaxis_pt  [Input]
			point on the xaxis of the map plane
		origin  [Input]
			origin of the map plane
		yaxis_pt  [Input]
			point on the yaxis of the map plane
		mplane  [Result]
			the map plane

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_3d_map_plane_from_trl_rot,fz_math_3d_map_plane_from_equc, 
		fz_math_3d_map_plane_to_world,fz_math_3d_map_plane_to_world_array, 
		fz_math_3d_map_plane_to_plane,fz_math_3d_map_plane_to_plane_array, 
		fz_math_3d_map_plane_get_matrix

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_map_plane_from_pts_func) (
	fz_xyz_td				*xaxis_pt,
	fz_xyz_td				*origin,
	fz_xyz_td				*yaxis_pt,
	fz_map_plane_td 	*mplane
	);

/****************************************************************

	fz_math_3d_map_plane_from_trl_rot



	Description
		Defines a map plane, given an origin (trl) and three rotation angles (rot) 
		applied in z y x order

	Parameters
		trl  [Input]
			the map plane origin
		rot  [Input]
			the map plane rotation angles, applied in z y x order
		mplane  [Result]
			the map plane

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_3d_map_plane_from_pts,fz_math_3d_map_plane_from_equc, 
		fz_math_3d_map_plane_to_world,fz_math_3d_map_plane_to_world_array, 
		fz_math_3d_map_plane_to_plane,fz_math_3d_map_plane_to_plane_array, 
		fz_math_3d_map_plane_get_matrix

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_map_plane_from_trl_rot_func) (
	fz_xyz_td				*trl,
	fz_xyz_td				*rot,
	fz_map_plane_td 	*mplane
	);

/****************************************************************

	fz_math_3d_map_plane_from_equc



	Description
		Defines a map plane, given a plane equation. The orientation of the 
		map plane x and y axis within the plane is chosen arbitrarily.

	Parameters
		equ  [Input]
			the map plane's plane equation.
		mplane  [Result]
			the map plane

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_3d_map_plane_from_pts,fz_math_3d_map_plane_from_trl_rot, 
		fz_math_3d_map_plane_to_world,fz_math_3d_map_plane_to_world_array, 
		fz_math_3d_map_plane_to_plane,fz_math_3d_map_plane_to_plane_array, 
		fz_math_3d_map_plane_get_matrix,fz_math_3d_map_plane_to_equc

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_map_plane_from_equc_func) (
	fz_plane_equ_td 			*equ,
	fz_map_plane_td 	*mplane
	);
	
/****************************************************************

	fz_math_3d_map_plane_to_equc



	Description
		Returns the plane equation for the given map plane

	Parameters
		mplane  [Input]
			the map plane
		equ  [Result]
			the map plane's plane equation.

	Returns
		Error codes


	Availability	7.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_3d_map_plane_from_pts,fz_math_3d_map_plane_from_trl_rot, 
		fz_math_3d_map_plane_to_world,fz_math_3d_map_plane_to_world_array, 
		fz_math_3d_map_plane_to_plane,fz_math_3d_map_plane_to_plane_array, 
		fz_math_3d_map_plane_get_matrix,fz_math_3d_map_plane_from_equc

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_map_plane_to_equc_func) (
	fz_map_plane_td 	*mplane,
	fz_plane_equ_td 	*equ
	);

/****************************************************************

	fz_math_3d_map_plane_to_world



	Description
		Transforms a point from the map plane's coordinate system to the world's 
		coordinate system.

	Parameters
		mplane  [Input]
			the map plane
		pnt  [Input, Result]
			the point to be transformed

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_3d_map_plane_from_pts,fz_math_3d_map_plane_from_trl_rot, 
		fz_math_3d_map_plane_from_equc,fz_math_3d_map_plane_to_world_array, 
		fz_math_3d_map_plane_to_plane,fz_math_3d_map_plane_to_plane_array, 
		fz_math_3d_map_plane_get_matrix

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_map_plane_to_world_func) (
	fz_map_plane_td 	*mplane,
	fz_xyz_td				*pnt
	);

/****************************************************************

	fz_math_3d_map_plane_to_world_array



	Description
		Transforms an array of points from the map plane's coordinate system to the world's 
		coordinate system.

	Parameters
		mplane  [Input]
			the map plane
		pnts  [Input, Result]
			the points to be transformed
		npnts  [Input]
			the number of points to be transformed

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_3d_map_plane_from_pts,fz_math_3d_map_plane_from_trl_rot, 
		fz_math_3d_map_plane_from_equc,fz_math_3d_map_plane_to_world, 
		fz_math_3d_map_plane_to_plane,fz_math_3d_map_plane_to_plane_array, 
		fz_math_3d_map_plane_get_matrix

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_map_plane_to_world_array_func) (
	fz_map_plane_td 	*mplane,
	fz_xyz_td				*pnts,
	fzrt_int				npnts
	);

/****************************************************************

	fz_math_3d_map_plane_to_plane



	Description
		Transforms a point from the world's coordinate system to the map plane's 
		coordinate system.

	Parameters
		mplane  [Input]
			the map plane
		pnt  [Input, Result]
			the point to be transformed

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_3d_map_plane_from_pts,fz_math_3d_map_plane_from_trl_rot, 
		fz_math_3d_map_plane_from_equc,fz_math_3d_map_plane_to_world, 
		fz_math_3d_map_plane_to_world_array,fz_math_3d_map_plane_to_plane_array, 
		fz_math_3d_map_plane_get_matrix

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_map_plane_to_plane_func) (
	fz_map_plane_td 	*mplane,
	fz_xyz_td				*pnt
	);

/****************************************************************

	fz_math_3d_map_plane_to_plane_array



	Description
		Transform an array of points from the world's coordinate system to the map plane's 
		coordinate system.

	Parameters
		mplane  [Input]
			the map plane
		pnts  [Input, Result]
			the points to be transformed
		npnts  [Input]
			the number of points to be transformed

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_3d_map_plane_from_pts,fz_math_3d_map_plane_from_trl_rot, 
		fz_math_3d_map_plane_from_equc,fz_math_3d_map_plane_to_world, 
		fz_math_3d_map_plane_to_plane,fz_math_3d_map_plane_to_world_array, 
		fz_math_3d_map_plane_get_matrix

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_map_plane_to_plane_array_func) (
	fz_map_plane_td 	*mplane,
	fz_xyz_td				*pnts,
	fzrt_int				npnts
	);

/****************************************************************

	fz_math_3d_map_plane_get_matrix



	Description
		Gets the matrix from the map plane, which transforms from the 
		plane's coordinate system to the world coordinate system.

	Parameters
		mplane  [Input]
			the map plane
		mat  [Result]
			the matrix which transforms from the plane to the world

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl

	See Also
		fz_math_3d_map_plane_from_pts,fz_math_3d_map_plane_from_trl_rot, 
		fz_math_3d_map_plane_from_equc,fz_math_3d_map_plane_to_world, 
		fz_math_3d_map_plane_to_plane,fz_math_3d_map_plane_to_world_array, 
		fz_math_3d_map_plane_to_plane_array

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_map_plane_get_matrix_func) (
	fz_map_plane_td 	*mplane,
	fz_mat4x4_td		*mat
	);

/****************************************************************

	fz_math_3d_xyz_mm_to_pnts



	Description
		Converts a fz_xyz_mm_td into an array of 8 fz_xyz_td representing 
		the corners of the bounding box. The pnts array passed in must be 
		allocated by the calling function to at least 8 items.

	Parameters
		bbox  [Input]
			the bounding box
		pnts  [Result]
			the 8 points representing the corners of the box. The pnts 
			array must be allocated by the calling function to at 
			least 8 items.

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_3d.fsl
 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3d_xyz_mm_to_pnts_func) (
	fz_xyz_mm_td 			*bbox,
	fz_xyz_td 				*pnts
	);


/****************************************************************

	fz_math_3x3_set_identity



	Description
		Initializes a 3x3 matrix to the identity matrix.

	Parameters
		mat  [Input, Result]
			3x3 matrix

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_4x4_set_identity

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3x3_set_identity_func)(
	fz_mat3x3_td	*mat
	);

/****************************************************************

	fz_math_3x3_copy



	Description
		Copies a 3x3 matrix.

	Parameters
		mat_in  [Input]
			source 3x3 matrix
		mat_out  [Result]
			destination 3x3 matrix

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_4x4_copy

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3x3_copy_func)(
	fz_mat3x3_td	*mat_in,
	fz_mat3x3_td	*mat_out
	);

/****************************************************************

	fz_math_3x3_invert



	Description
		Inverts a 3x3 matrix. 
		Note : mat_in and mat_out can be passed as the same pointer.

	Parameters
		mat_in  [Input]
			3x3 matrix to invert
		mat_out  [Result]
			inverted 3x3 matrix

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_4x4_invert

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3x3_invert_func)(
	fz_mat3x3_td	*mat_in,
	fz_mat3x3_td	*mat_out
	);

/****************************************************************

	fz_math_3x3_is_identity



	Description
		Checks whether a 3x3 matrix is the identity matrix.

	Parameters
		mat  [Input]
			3x3 matrix

	Returns
		TRUE if identity, FALSE otherwise


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_4x4_is_identity

 ****************************************************************/
typedef fzrt_boolean	 (*fz_math_3x3_is_identity_func)(
	fz_mat3x3_td	*mat
	);

/****************************************************************

	fz_math_3x3_multiply_mat_mat



	Description
		Multiplies two 3x3 matrices. 
		Stores the result in a third matrix. 
		Either input matrix (mat1 or mat2) can be used as the resultant matrix (dst_mat).

	Parameters
		mat1  [Input]
			source 3x3 matrix 1
		mat2  [Input]
			source 3x3 matrix 2
		dst_mat  [Result]
			multplied 3x3 matrix

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_4x4_multiply_mat_mat

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3x3_multiply_mat_mat_func)(
	fz_mat3x3_td	*mat1,
	fz_mat3x3_td	*mat2,
	fz_mat3x3_td	*dst_mat
	);

/****************************************************************

	fz_math_3x3_multiply_mat_xy



	Description
		Mutiplies a 2d point by a 3x3 matrix. 
		Returns the resultant 2d point in the same parameter as the input point (pt).

	Parameters
		mat  [Input]
			3x3 matrix
		pt  [Input, Result]
			2d point

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_3x3_multiply_mat_xy_array, 
		fz_math_3x3_multiply_mat_xyz,fz_math_3x3_multiply_mat_xyz_array

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3x3_multiply_mat_xy_func)(
	fz_mat3x3_td	*mat,
	fz_xy_td			*pt
	);

/****************************************************************

	fz_math_3x3_multiply_mat_xy_array



	Description
		Mutiplies an array of 2d points by a 3x3 matrix. 
		Returns the resultant 2d points in the same parameter 
		array as the input points (pts).

	Parameters
		mat  [Input]
			3x3 matrix
		pts  [Input, Result]
			2d points array
		knt  [Input]
			number of points

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_3x3_multiply_mat_xy, 
		fz_math_3x3_multiply_mat_xyz,fz_math_3x3_multiply_mat_xyz_array

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3x3_multiply_mat_xy_array_func)(
	fz_mat3x3_td	*mat,
	fz_xy_td			*pts,
	fzrt_int			knt
	);

/****************************************************************

	fz_math_3x3_multiply_mat_xyz



	Description
		Mutiplies a 3d point by a 3x3 matrix. 
		Returns the resultant 3d point in the same parameter as the input point (pt).

	Parameters
		mat  [Input]
			3x3 matrix
		pt  [Input, Result]
			3d point

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_3x3_multiply_mat_xy,fz_math_3x3_multiply_mat_xy_array, 
		fz_math_3x3_multiply_mat_xyz_array

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3x3_multiply_mat_xyz_func)(
	fz_mat3x3_td	*mat,
	fz_xyz_td			*pt
	);

/****************************************************************

	fz_math_3x3_multiply_mat_xyz_array



	Description
		Mutiplies an array of 3d points by a 3x3 matrix. 
		Returns the resultnat 3d points in the same parameter 
		array as the input points (pts).

	Parameters
		mat  [Input]
			3x3 matrix
		pts  [Input, Result]
			3d points array
		knt  [Input]
			number of points

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_3x3_multiply_mat_xy,fz_math_3x3_multiply_mat_xy_array, 
		fz_math_3x3_multiply_mat_xyz

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3x3_multiply_mat_xyz_array_func)(
	fz_mat3x3_td	*mat,
	fz_xyz_td			*pts,
	fzrt_int			knt
	);

/****************************************************************

	fz_math_3x3_mat_to_trl_scl_rot



	Description
		Breaks a 3x3 matrix into translation, scale and rotation parameters. 
		This is the inverse operation of fz_math_3x3_mat_from_trl_scl_rot.

	Parameters
		mat  [Input]
			3x3 matrix
		trl  [Result, Optional]
			translation
		scl  [Result, Optional]
			scale
		rot  [Result, Optional]
			rotation

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_3x3_mat_from_trl_scl_rot,fz_math_4x4_mat_to_trl_scl_rot

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3x3_mat_to_trl_scl_rot_func)(
	fz_mat3x3_td	*mat,
	fz_xy_td			*trl,
	fz_xy_td			*scl,
	double			*rot
	);

/****************************************************************

	fz_math_3x3_is_uniform_scale



	Description
		Checks whether a 3x3 matrix has a uniform scale factor. 
		If the scale factor is uniform, 
		the scale factor can be optionally returned.

	Parameters
		mat  [Input]
			3x3 matrix
		scale  [Result, Optional]
			scale factor

	Returns
		TRUE if matrix has uniform scale, FALSE otherwise


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_4x4_is_uniform_scale

 ****************************************************************/
typedef fzrt_boolean	 (*fz_math_3x3_is_uniform_scale_func)(
	fz_mat3x3_td	*mat,
	double			*scale
	);

/****************************************************************

	fz_math_3x3_set_trl_mat



	Description
		Initializes a 3x3 matrix to a translation matrix using a 
		given 2d translation vector.

	Parameters
		mat  [Input, Result]
			3x3 matrix
		trl  [Input]
			translation vector

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_3x3_set_rot_mat,fz_math_3x3_set_rot_cntr_mat, 
		fz_math_3x3_set_scl_mat,fz_math_3x3_set_scl_cntr_mat, 
		fz_math_3x3_set_refl_mat

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3x3_set_trl_mat_func)(
	fz_mat3x3_td	*mat,
	fz_xy_td			*trl
	);

/****************************************************************

	fz_math_3x3_set_rot_mat



	Description
		Initializes a 3x3 matrix to a rotation matrix about the origin 
		at a given angle.

	Parameters
		mat  [Input, Result]
			3x3 matrix
		angle  [Input]
			rotation angle

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_3x3_set_trl_mat,fz_math_3x3_set_rot_cntr_mat, 
		fz_math_3x3_set_scl_mat,fz_math_3x3_set_scl_cntr_mat, 
		fz_math_3x3_set_refl_mat

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3x3_set_rot_mat_func)(
	fz_mat3x3_td	*mat,
	double			angle
	);

/****************************************************************

	fz_math_3x3_set_rot_cntr_mat



	Description
		Initializes a 3x3 matrix to a rotation matrix about a given 2d point 
		at a given angle.

	Parameters
		mat  [Input, Result]
			3x3 matrix
		angle  [Input]
			rotation angle
		cntr  [Input]
			point to rotate matrix about

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_3x3_set_trl_mat,fz_math_3x3_set_rot_mat, 
		fz_math_3x3_set_scl_mat,fz_math_3x3_set_scl_cntr_mat, 
		fz_math_3x3_set_refl_mat

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3x3_set_rot_cntr_mat_func)(
	fz_mat3x3_td	*mat,
	double			angle,
	fz_xy_td			*cntr
	);

/****************************************************************

	fz_math_3x3_set_scl_mat



	Description
		Initializes a 3x3 matrix to a scale matrix using a given 2d scale vector.

	Parameters
		mat  [Input, Result]
			3x3 matrix
		scl  [Input]
			2d scale vector

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_3x3_set_trl_mat,fz_math_3x3_set_rot_mat, 
		fz_math_3x3_set_rot_cntr_mat,fz_math_3x3_set_scl_cntr_mat, 
		fz_math_3x3_set_refl_mat

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3x3_set_scl_mat_func)(
	fz_mat3x3_td	*mat,
	fz_xy_td			*scl
	);

/****************************************************************

	fz_math_3x3_set_scl_cntr_mat



	Description
		Initializes a 3x3 matrix to a scale matrix using a given scale vector and 
		a center about which the scale is performed.

	Parameters
		mat  [Input, Result]
			3x3 matrix
		scl  [Input]
			2d scale vector
		cntr  [Input]
			2d point about which the scale is performed

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_3x3_set_trl_mat,fz_math_3x3_set_rot_mat,fz_math_3x3_set_rot_cntr_mat, 
		fz_math_3x3_set_scl_mat,fz_math_3x3_set_refl_mat

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3x3_set_scl_cntr_mat_func)(
	fz_mat3x3_td	*mat,
	fz_xy_td			*scl,
	fz_xy_td			*cntr
	);

/****************************************************************

	fz_math_3x3_set_refl_mat



	Description
		Initializes a 3x3 matrix to a reflection matrix. 
		Reflects about a line parallel to the x or y axis at 
		a given distance from the origin.

	Parameters
		mat  [Input, Result]
			3x3 matrix
		which_axis  [Input]
			axis to reflect about 
			either FZ_AXIS_X or FZ_AXIS_Y
		dist  [Input]
			distance of reflection line from origin

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_3x3_set_trl_mat,fz_math_3x3_set_rot_mat,fz_math_3x3_set_rot_cntr_mat, 
		fz_math_3x3_set_scl_mat,fz_math_3x3_set_scl_cntr_mat

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3x3_set_refl_mat_func)(
	fz_mat3x3_td	*mat,
	fz_axis_enum	which_axis,
	double			dist
	);

/****************************************************************

	fz_math_3x3_mat_from_trl_scl_rot



	Description
		Create a complete transformation 3x3 matrix consisting of translation, 
		scale and rotation components. 
		These components are executed in the order : 
		1. scale 
		2. rotation 
		3. translation 
		This is the inverse operation of fz_math_3x3_mat_to_trl_scl_rot.

	Parameters
		trl  [Input, Optional]
			scale
			Default Value: identity matrix
		scl  [Input, Optional]
			rotation
			Default Value: identity matrix
		rot  [Input, Optional]
			translation
			Default Value: identity matrix
		mat  [Result]
			3x3 transformation matrix

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_3x3_mat_to_trl_scl_rot

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3x3_mat_from_trl_scl_rot_func)(
	fz_xy_td			*trl,
	fz_xy_td			*scl,
	double			*rot,
	fz_mat3x3_td	*mat
	);

/****************************************************************

	fz_math_3x3_multiply_mat_unit_vec



	Description
		Transforms a 2d unit vector by a 3x3 matrix. 
		If no_scale is TRUE, it assumes the matrix contains translation 
		and rotation only and the result vector is not normalized again. 
		If no_scale is to FALSE, the result vector is normzlized.  
		If in doubt whether the matix contains a scale factor, set no_scale to FALSE.

	Parameters
		mat  [Input]
			3x3 matrix
		unit_vec  [Input, Result]
			2d unit vector
		no_scale  [Input]
			TRUE if matrix doesn't contain a scale factor, 
			FALSE if matrix does contain a scale factor

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_4x4_multiply_mat_unit_vec

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3x3_multiply_mat_unit_vec_func)(
	fz_mat3x3_td	*mat,
	fz_xy_td			*unit_vec,
	fzrt_boolean	no_scale
	);
		
/****************************************************************

	fz_math_3x3_solve



	Description
		3x2 matrix solver. 
		Input is a 3x2 matrix (last row of 3x3 matrix is unused). 
		The rows of the matrix represent two equations in the form 
		ax + by + c = 0 where a, b, c are the values in each row of the matrix. 
		The output is an 2d vector with the resulting values for x and y.

	Parameters
		mat  [Input]
			3x2 matrix (last row unused)
		vec  [Result]
			2d vector

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_4x4_solve

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3x3_solve_func)(
	fz_mat3x3_td	*mat,
	fz_xy_td			*vec
	);

/****************************************************************

	fz_math_3x3_mat_field_set



	Description
		Sets an individual field of a 3x3 array. 
		i is the row and j is the column. 
		value is stored in mat[i][j].

	Parameters
		mat  [Input]
			3x3 matrix
		i  [Input]
			row to change
		j  [Input]
			column to change
		value  [Input]
			value to put in matrix

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_3x3_mat_field_get,fz_math_4x4_mat_field_set

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3x3_mat_field_set_func)(
	fz_mat3x3_td	*mat,
	fzrt_int			i,
	fzrt_int			j,
	double			value
	);

/****************************************************************

	fz_math_3x3_mat_field_get



	Description
		Gets an individual field of a 3x3 array. 
		i is the row and j is the column. 
		value retrieved is from mat[i][j].

	Parameters
		mat  [Input]
			3x3 matrix
		i  [Input]
			row to change
		j  [Input]
			column to change
		value  [Result]
			value stored in matrix

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_3x3_mat_field_set,fz_math_4x4_mat_field_get

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_3x3_mat_field_get_func)(
	fz_mat3x3_td	*mat,
	fzrt_int			i,
	fzrt_int			j,
	double			*value
	);

/****************************************************************

	fz_math_4x4_set_identity



	Description
		Initializes a 4x4 matrix to the identity matrix.

	Parameters
		mat  [Input, Result]
			4x4 matrix

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_3x3_set_identity

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_4x4_set_identity_func)(
	fz_mat4x4_td	*mat
	);

/****************************************************************

	fz_math_4x4_is_identity



	Description
		Checks whether a 4x4 matrix is the identity matrix.

	Parameters
		mat  [Input]
			4x4 matrix

	Returns
		TRUE if identity, FALSE otherwise


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_3x3_is_identity

 ****************************************************************/
typedef fzrt_boolean	 (*fz_math_4x4_is_identity_func)(
	fz_mat4x4_td	*mat
	);

/****************************************************************

	fz_math_4x4_copy



	Description
		Copies a 4x4 matrix.

	Parameters
		src_mat  [Input]
			source 4x4 matrix
		dst_mat  [Result]
			destination 4x4 matrix

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_3x3_copy

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_4x4_copy_func)(
	fz_mat4x4_td	*src_mat,
	fz_mat4x4_td	*dst_mat
	);

/****************************************************************

	fz_math_4x4_multiply_mat_mat



	Description
		Multiply two 4x4 matrices. 
		Store the result in a third matrix. 
		Either input matrix (mat1 or mat2) can be used as the resultant matrix (dst_mat).

	Parameters
		mat1  [Input]
			source 4x4 matrix 1
		mat2  [Input]
			source 4x4 matrix 2
		dst_mat  [Result]
			multiplied 4x4 matrix

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_3x3_multiply_mat_mat

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_4x4_multiply_mat_mat_func)(
	fz_mat4x4_td	*mat1,
	fz_mat4x4_td	*mat2,
	fz_mat4x4_td	*dst_mat
	);

/****************************************************************

	fz_math_4x4_set_rot_mat



	Description
		Initializes a 4x4 matrix to a rotation matrix. 
		Rotates around the x, y or z axis at a given angle in radians.

	Parameters
		mat  [Input, Result]
			4x4 matrix
		angle  [Input]
			rotation angle in radians
		which_axis  [Input]
			axis to rotate matrix about

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_4x4_set_scl_mat,fz_math_4x4_set_trl_mat,FZ_MATH_DEG_2_RAD

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_4x4_set_rot_mat_func)(
	fz_mat4x4_td	*mat,
	double			angle,
	fz_axis_enum	which_axis
	);

/****************************************************************

	fz_math_4x4_set_scl_mat



	Description
		Initializes a 4x4 matrix to a scale matrix using a given scale vector.

	Parameters
		mat  [Input, Result]
			4x4 matrix
		scl  [Input]
			scale vector

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_4x4_set_rot_mat,fz_math_4x4_set_trl_mat

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_4x4_set_scl_mat_func)(
	fz_mat4x4_td	*mat,
	fz_xyz_td			*scl
	);

/****************************************************************

	fz_math_4x4_set_trl_mat



	Description
		Initializes a 4x4 matrix to a translation matrix using a 
		given translation vector.

	Parameters
		mat  [Input, Result]
			4x4 matrix
		trl  [Input]
			translation vector

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_4x4_set_rot_mat,fz_math_4x4_set_scl_mat

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_4x4_set_trl_mat_func)(
	fz_mat4x4_td	*mat,
	fz_xyz_td			*trl
	);

/****************************************************************

	fz_math_4x4_multiply_mat_xyz_xyzw



	Description
		Mutiplies a 3d point by a 4x4 matrix. 
		Returns the resultant 4d point in the same parameter as the input point (pt). 
		Note : although a 4d point, only x, y and z are used from 
		the input point. 
		Since multiplying a 3d point by a 4x4 results in a 4x1 vector, 
		the w of the output point is calculated.

	Parameters
		mat  [Input]
			4x4 matrix
		pt  [Input, Result]
			point 
			w not used on input

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_4x4_multiply_mat_xyz_xyzw_array, 
		fz_math_4x4_multiply_mat_xyzw,fz_math_4x4_multiply_mat_xyzw_array, 
		fz_math_4x4_multiply_mat_xyz,fz_math_4x4_multiply_mat_xyz_array, 
		fz_math_4x4_multiply_mat_xy,fz_math_4x4_multiply_mat_xy_array, 
		fz_math_4x4_multiply_mat_unit_vec

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_4x4_multiply_mat_xyz_xyzw_func)(
	fz_mat4x4_td	*mat,
	fz_xyzw_td			*pt
	);

/****************************************************************

	fz_math_4x4_multiply_mat_xyz_xyzw_array



	Description
		Mutiplies an array of 3d points by a 4x4 matrix. 
		Returns the resultant 4d points in the same array parameter as the input points (pts). 
		Note : although an array of 4d points, only x, y and z are used from 
		the input points. 
		Since multiplying a 3d point by a 4x4 results in a 4x1 vector, 
		the w of the output point is calculated.

	Parameters
		mat  [Input]
			4x4 matrix
		pts  [Input, Result]
			points array 
			w not used on input
		knt  [Input]
			number of points in array

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_4x4_multiply_mat_xyz_xyzw, 
		fz_math_4x4_multiply_mat_xyzw,fz_math_4x4_multiply_mat_xyzw_array, 
		fz_math_4x4_multiply_mat_xyz,fz_math_4x4_multiply_mat_xyz_array, 
		fz_math_4x4_multiply_mat_xy,fz_math_4x4_multiply_mat_xy_array, 
		fz_math_4x4_multiply_mat_unit_vec

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_4x4_multiply_mat_xyz_xyzw_array_func)(
	fz_mat4x4_td	*mat,
	fz_xyzw_td 		*pts,
	fzrt_int			knt
	);

/****************************************************************

	fz_math_4x4_multiply_mat_xyzw



	Description
		Mutiplies a 4d point by a 4x4 matrix. 
		Returns the resultant 4d point in the same parameter as the input point (pt). 
		Unlike fz_math_4x4_multiply_mat_xyz_xyzw, this function uses w from the input.

	Parameters
		mat  [Input]
			4x4 matrix
		pt  [Input, Result]
			4d point

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_4x4_multiply_mat_xyz_xyzw,fz_math_4x4_multiply_mat_xyz_xyzw_array, 
		fz_math_4x4_multiply_mat_xyzw_array, 
		fz_math_4x4_multiply_mat_xyz,fz_math_4x4_multiply_mat_xyz_array, 
		fz_math_4x4_multiply_mat_xy,fz_math_4x4_multiply_mat_xy_array, 
		fz_math_4x4_multiply_mat_unit_vec

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_4x4_multiply_mat_xyzw_func)(
	fz_mat4x4_td	*mat,
	fz_xyzw_td			*pt
	);

/****************************************************************

	fz_math_4x4_multiply_mat_xyzw_array



	Description
		Mutiplies an array of 4d points by a 4x4 matrix. 
		Returns the resultant 4d points in the same array parameter as the input points (pts). 
		Unlike fz_math_4x4_multiply_mat_xyz_xyzw_array, this function uses w from the input.

	Parameters
		mat  [Input]
			4x4 matrix
		pts  [Input, Result]
			points array
		knt  [Input]
			number of points in array

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_4x4_multiply_mat_xyz_xyzw,fz_math_4x4_multiply_mat_xyz_xyzw_array, 
		fz_math_4x4_multiply_mat_xyzw, 
		fz_math_4x4_multiply_mat_xyz,fz_math_4x4_multiply_mat_xyz_array, 
		fz_math_4x4_multiply_mat_xy,fz_math_4x4_multiply_mat_xy_array, 
		fz_math_4x4_multiply_mat_unit_vec

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_4x4_multiply_mat_xyzw_array_func)(
	fz_mat4x4_td	*mat,
	fz_xyzw_td			*pts,
	fzrt_int			knt
	);

/****************************************************************

	fz_math_4x4_multiply_mat_xyz



	Description
		Mutiplies a 3d point by a 4x4 matrix. 
		Returns the resultant 3d point in the same parameter as the input point (pt).

	Parameters
		mat  [Input]
			4x4 matrix
		pt  [Input, Result]
			point

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_4x4_multiply_mat_xyz_xyzw,fz_math_4x4_multiply_mat_xyz_xyzw_array, 
		fz_math_4x4_multiply_mat_xyzw,fz_math_4x4_multiply_mat_xyzw_array, 
		fz_math_4x4_multiply_mat_xyz_array, 
		fz_math_4x4_multiply_mat_xy,fz_math_4x4_multiply_mat_xy_array, 
		fz_math_4x4_multiply_mat_unit_vec

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_4x4_multiply_mat_xyz_func)(
	fz_mat4x4_td	*mat,
	fz_xyz_td			*pt
	);

/****************************************************************

	fz_math_4x4_multiply_mat_xyz_array



	Description
		Mutiplies an array of 3d points by a 4x4 matrix. 
		Returns the resultant 3d points in the same array parameter as the input points (pts).

	Parameters
		mat  [Input]
			4x4 matrix
		pts  [Input, Result]
			points array
		knt  [Input]
			number of points in array

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_4x4_multiply_mat_xyz_xyzw,fz_math_4x4_multiply_mat_xyz_xyzw_array, 
		fz_math_4x4_multiply_mat_xyzw,fz_math_4x4_multiply_mat_xyzw_array, 
		fz_math_4x4_multiply_mat_xyz, 
		fz_math_4x4_multiply_mat_xy,fz_math_4x4_multiply_mat_xy_array, 
		fz_math_4x4_multiply_mat_unit_vec

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_4x4_multiply_mat_xyz_array_func)(
	fz_mat4x4_td	*mat,
	fz_xyz_td			*pts,
	fzrt_int			knt
	);

/****************************************************************

	fz_math_4x4_multiply_mat_unit_vec



	Description
		Transforms a 3d unit vector by a 4x4 matrix. 
		If no_scale is TRUE, it assumes the matrix contains translation 
		and rotation only and the result vector is not normalized again. 
		If no_scale is set to FALSE, the result vector is normalized. 
		If in doubt whether the matix contains a scale factor, set no_scale to FALSE.

	Parameters
		mat  [Input]
			4x4 matrix
		unit_vec  [Input, Result]
			3d unit vector
		no_scale  [Input]
			TRUE if matrix doesn't contain a scale factor, 
			FALSE if matrix does contain a scale factor

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_4x4_multiply_mat_xyz_xyzw,fz_math_4x4_multiply_mat_xyz_xyzw_array, 
		fz_math_4x4_multiply_mat_xyzw,fz_math_4x4_multiply_mat_xyzw_array, 
		fz_math_4x4_multiply_mat_xyz,fz_math_4x4_multiply_mat_xyz_array, 
		fz_math_4x4_multiply_mat_xy,fz_math_4x4_multiply_mat_xy_array, 
		fz_math_3x3_multiply_mat_unit_vec

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_4x4_multiply_mat_unit_vec_func)(
	fz_mat4x4_td	*mat,
	fz_xyz_td			*unit_vec,
	fzrt_boolean	no_scale
	);

/****************************************************************

	fz_math_4x4_multiply_mat_xy



	Description
		Mutiplies a 2d point by a 4x4 matrix. 
		Returns the resultant 2d point in the same parameter as the input point (pt).

	Parameters
		mat  [Input]
			4x4 matrix
		pt  [Input, Result]
			2d point

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_4x4_multiply_mat_xyz_xyzw,fz_math_4x4_multiply_mat_xyz_xyzw_array, 
		fz_math_4x4_multiply_mat_xyzw,fz_math_4x4_multiply_mat_xyzw_array, 
		fz_math_4x4_multiply_mat_xyz,fz_math_4x4_multiply_mat_xyz_array, 
		fz_math_4x4_multiply_mat_xy_array, 
		fz_math_4x4_multiply_mat_unit_vec

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_4x4_multiply_mat_xy_func)(
	fz_mat4x4_td	*mat,
	fz_xy_td			*pt
	);

/****************************************************************

	fz_math_4x4_multiply_mat_xy_array



	Description
		Mutiplies an array of 2d points by a 4x4 matrix. 
		Returns the resultant 2d points in the same array parameter as the input points (pts).

	Parameters
		mat  [Input]
			4x4 matrix
		pts  [Input, Result]
			2d points array
		knt  [Input]
			number of points in array

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_4x4_multiply_mat_xyz_xyzw,fz_math_4x4_multiply_mat_xyz_xyzw_array, 
		fz_math_4x4_multiply_mat_xyzw,fz_math_4x4_multiply_mat_xyzw_array, 
		fz_math_4x4_multiply_mat_xyz,fz_math_4x4_multiply_mat_xyz_array, 
		fz_math_4x4_multiply_mat_xy, 
		fz_math_4x4_multiply_mat_unit_vec

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_4x4_multiply_mat_xy_array_func)(
	fz_mat4x4_td	*mat,
	fz_xy_td			*pts,
	fzrt_int			knt
	);

/****************************************************************

	fz_math_4x4_set_scl_cntr_mat



	Description
		Initializes a 4x4 matrix to a scale matrix using a given 3d scale vector and 
		a 3d point about which the scale is performed.

	Parameters
		mat  [Input, Result]
			4x4 matrix
		scl  [Input]
			3d scale vector
		cntr  [Input]
			3d point about which the scale is performed

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_4x4_set_rot_cntr_mat, 
		fz_math_4x4_set_refl_mat,fz_math_4x4_set_refl_plane_mat, 
		fz_math_4x4_set_refl_line_mat,fz_math_4x4_set_refl_pt_mat

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_4x4_set_scl_cntr_mat_func)(
	fz_mat4x4_td	*mat,
	fz_xyz_td			*scl,
	fz_xyz_td			*cntr
	);

/****************************************************************

	fz_math_4x4_set_rot_cntr_mat



	Description
		Initializes a 4x4 matrix to a rotation matrix. 
		Rotates around the x, y or z axis through a given 
		3d point at a given angle in radians.

	Parameters
		mat  [Input, Result]
			4x4 matrix
		angle  [Input]
			rotation angle in radians
		cntr  [Input]
			3d point to rotate through
		which_axis  [Input]
			axis to rotate matrix about

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_4x4_set_scl_cntr_mat, 
		fz_math_4x4_set_refl_mat,fz_math_4x4_set_refl_plane_mat, 
		fz_math_4x4_set_refl_line_mat,fz_math_4x4_set_refl_pt_mat, 
		FZ_MATH_DEG_2_RAD

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_4x4_set_rot_cntr_mat_func)(
	fz_mat4x4_td	*mat,
	double			angle,
	fz_xyz_td			*cntr,
	fz_axis_enum	which_axis
	);

/****************************************************************

	fz_math_4x4_set_refl_mat



	Description
		Initializes a 4x4 matrix to a reflection matrix. 
		Reflects about a plane parallel to the YZ, ZX or XY plane at 
		a given distance from the origin.

	Parameters
		mat  [Input, Result]
			4x4 matrix
		which_plane  [Input]
			plane to reflect matrix about
		dist  [Input]
			distance of reflection plane from origin

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_4x4_set_scl_cntr_mat,fz_math_4x4_set_rot_cntr_mat, 
		fz_math_4x4_set_refl_plane_mat, 
		fz_math_4x4_set_refl_line_mat,fz_math_4x4_set_refl_pt_mat

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_4x4_set_refl_mat_func)(
	fz_mat4x4_td	*mat,
	fz_plane_enum	which_plane,
	double			dist
	);

/****************************************************************

	fz_math_4x4_set_refl_plane_mat



	Description
		Initializes a 4x4 matrix to a reflection matrix. 
		Reflects about an arbitrary plane.

	Parameters
		mat  [Input, Result]
			4x4 matrix
		equ  [Input]
			plane to reflect matrix about

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_4x4_set_scl_cntr_mat,fz_math_4x4_set_rot_cntr_mat, 
		fz_math_4x4_set_refl_mat, 
		fz_math_4x4_set_refl_line_mat,fz_math_4x4_set_refl_pt_mat

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_4x4_set_refl_plane_mat_func)(
	fz_mat4x4_td	*mat,
	fz_plane_equ_td			*equ
	);

/****************************************************************

	fz_math_4x4_set_refl_line_mat



	Description
		Initializes a 4x4 matrix to a reflection matrix. 
		Reflects about an arbitrary 3d line, defined by two points. 
		This is equal to a rotation of 180 degrees about that line.

	Parameters
		mat  [Input, Result]
			4x4 matrix
		line_pt1  [Input]
			point 1 of 3d line to reflect matrix about
		line_pt2  [Input]
			point 2 of 3d line to reflect matrix about

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_4x4_set_scl_cntr_mat,fz_math_4x4_set_rot_cntr_mat, 
		fz_math_4x4_set_refl_mat,fz_math_4x4_set_refl_plane_mat, 
		fz_math_4x4_set_refl_pt_mat

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_4x4_set_refl_line_mat_func) (
	fz_mat4x4_td	*mat,
	fz_xyz_td			*line_pt1,
	fz_xyz_td			*line_pt2
	);

/****************************************************************

	fz_math_4x4_set_refl_pt_mat



	Description
		Initializes a 4x4 matrix to a reflection matrix. 
		Reflects about a 3d point.

	Parameters
		mat  [Input, Result]
			4x4 matrix
		pt  [Input]
			3d point to reflect matrix about

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_4x4_set_scl_cntr_mat,fz_math_4x4_set_rot_cntr_mat, 
		fz_math_4x4_set_refl_mat,fz_math_4x4_set_refl_plane_mat, 
		fz_math_4x4_set_refl_line_mat

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_4x4_set_refl_pt_mat_func) (
	fz_mat4x4_td	*mat,
	fz_xyz_td			*pt
	);
	
/****************************************************************

	fz_math_4x4_is_uniform_scale



	Description
		Check whether a 4x4 matrix has a uniform scale factor. 
		If the scale factor is uniform, 
		the scale factor can be optionally returned.

	Parameters
		mat  [Input]
			4x4 matrix
		scale  [Result, Optional]
			scale factor

	Returns
		TRUE if matrix has uniform scale, FALSE otherwise


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_3x3_is_uniform_scale

 ****************************************************************/
typedef fzrt_boolean	 (*fz_math_4x4_is_uniform_scale_func)(
	fz_mat4x4_td	*mat,
	double			*scale
	);

/****************************************************************

	fz_math_4x4_mat_to_trl_scl_rot



	Description
		Breaks a 4x4 matrix into translation, scale and rotation parameters. 
		Note : rotation parameters are in the sequence z y x

	Parameters
		mat  [Input]
			4x4 matrix
		trl  [Result, Optional]
			translation
		scl  [Result, Optional]
			scale
		rot  [Result, Optional]
			rotation

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_4x4_mat_from_trl_scl_rot,fz_math_3x3_mat_to_trl_scl_rot

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_4x4_mat_to_trl_scl_rot_func)(
	fz_mat4x4_td	*mat,
	fz_xyz_td			*trl,
	fz_xyz_td			*scl,
	fz_xyz_td			*rot
	);

/****************************************************************

	fz_math_4x4_mat_from_trl_scl_rot



	Description
		Create a complete transformation 4x4 matrix consisting of translation, 
		scale and rotation components. 
		These components are executed in the order : 
		1. scale 
		2. rotation 
		3. translation 
		This is the inverse operation of fz_math_4x4_mat_to_trl_scl_rot.

	Parameters
		trl  [Input, Optional]
			translation
			Default Value: identity matrix
		scl  [Input, Optional]
			scale
			Default Value: identity matrix
		rot  [Input, Optional]
			rotation
			Default Value: identity matrix
		mat  [Result]
			4x4 transformation matrix

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_4x4_mat_to_trl_scl_rot

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_4x4_mat_from_trl_scl_rot_func)(
	fz_xyz_td			*trl,
	fz_xyz_td			*scl,
	fz_xyz_td			*rot,
	fz_mat4x4_td	*mat
	);

/****************************************************************

	fz_math_4x4_invert



	Description
		Invert a 4x4 matrix. 
		Note : mat_in and mat_out can be passed as the same pointer.

	Parameters
		mat_in  [Input]
			4x4 matrix to invert
		mat_out  [Result]
			inverted 4x4 matrix

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_3x3_invert

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_4x4_invert_func)(
	fz_mat4x4_td	*mat_in,
	fz_mat4x4_td	*mat_out
	);

/****************************************************************

	fz_math_4x4_solve



	Description
		4x3 matrix solver. 
		Input is a 4x3 matrix (last row of 4x4 matrix is unused). 
		The rows of the matrix represent three equations in the form 
		ax + by + cz + d = 0 where a, b, c, d are the values in each row of the matrix. 
		The output is a 3d vector with the resulting values for x, y and z.

	Parameters
		mat  [Input]
			4x3 matrix (last row unused)
		vec  [Result]
			3d vector

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_3x3_solve

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_4x4_solve_func)(
	fz_mat4x4_td	*mat,
	fz_xyz_td			*vec
	);

/****************************************************************

	fz_math_4x4_mat_field_set



	Description
		Sets an individual field of a 4x4 array. 
		i is the row and j is the column. 
		value is stored in mat[i][j].

	Parameters
		mat  [Input]
			4x4 matrix
		i  [Input]
			row to change
		j  [Input]
			column to change
		value  [Input]
			value to put in matrix

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_4x4_mat_field_get,fz_math_3x3_mat_field_set

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_4x4_mat_field_set_func)(
	fz_mat4x4_td	*mat,
	fzrt_int			i,
	fzrt_int			j,
	double			value
	);

/****************************************************************

	fz_math_4x4_mat_field_get



	Description
		Gets an individual field of a 4x4 array. 
		i is the row and j is the column. 
		value retrieved is from mat[i][j].

	Parameters
		mat  [Input]
			4x4 matrix
		i  [Input]
			row to change
		j  [Input]
			column to change
		value  [Result]
			value stored in matrix

	Returns
		Error codes


	Availability	5.0.0.0

	Example Files
		../../../../Scripts/Samples/Utilities/util_math_matrix.fsl

	See Also
		fz_math_4x4_mat_field_set,fz_math_3x3_mat_field_get

 ****************************************************************/
typedef fzrt_error_td	 (*fz_math_4x4_mat_field_get_func)(
	fz_mat4x4_td	*mat,
	fzrt_int			i,
	fzrt_int			j,
	double			*value
	);

/****************************************************************

	fz_math_fset


	FZ_MATH_FSET_TYPE
		formZ math function set UUID.

	FZ_MATH_FSET_NAME
		formZ math function set name.

	FZ_MATH_FSET_VERSION
		formZ math function set version.

	Description
		formZ math function set

	Availability	5.0.0.0

 ****************************************************************/


#define FZ_MATH_FSET_TYPE		"\x67\x12\xef\xc6\xd4\x77\x46\xfc\xa6\xc6\x6d\xea\x20\xff\x81\x63"

#define FZ_MATH_FSET_NAME		"formZ math functions"

#define FZ_MATH_FSET_VERSION	FZPL_VERS_MAKE(7,0,0,0)

typedef struct fz_math_fset
{
	fzpl_fset_prvt_data_td				prvt_data;

	fz_math_random_range_func						fz_math_random_range;
	fz_math_is_valid_double_func					fz_math_is_valid_double;
	
	fz_math_2d_is_zero_len_vec_func					fz_math_2d_is_zero_len_vec;
	fz_math_2d_is_unit_len_vec_func					fz_math_2d_is_unit_len_vec;
	fz_math_2d_angle_of_line_seg_func				fz_math_2d_angle_of_line_seg;
	fz_math_2d_is_pt_between_pts_func				fz_math_2d_is_pt_between_pts;
	fz_math_2d_is_parl_line_segs_func				fz_math_2d_is_parl_line_segs;
	fz_math_2d_normalize_vec_func					fz_math_2d_normalize_vec;
	fz_math_2d_perp_vec_func						fz_math_2d_perp_vec;
	fz_math_2d_pt_at_dist_ang_func					fz_math_2d_pt_at_dist_ang;
	fz_math_2d_center_3pt_circle_func				fz_math_2d_center_3pt_circle;
	fz_math_2d_isect_line_segs_func					fz_math_2d_isect_line_segs;
	fz_math_2d_isect_line_equs_func					fz_math_2d_isect_line_equs;
	fz_math_2d_project_pt_on_line_seg_func			fz_math_2d_project_pt_on_line_seg;
	fz_math_2d_colinear_3_pts_tol_func				fz_math_2d_colinear_3_pts_tol;
	fz_math_2d_colinear_3_pts_func					fz_math_2d_colinear_3_pts;
	fz_math_2d_equ_from_line_seg_func				fz_math_2d_equ_from_line_seg;
	fz_math_2d_line_seg_from_equ_func				fz_math_2d_line_seg_from_equ;
	fz_math_2d_parl_line_equ_func					fz_math_2d_parl_line_equ;
	fz_math_2d_equ_from_perp_line_func				fz_math_2d_equ_from_perp_line;
	fz_math_2d_is_pt_on_line_equ_func				fz_math_2d_is_pt_on_line_equ;
	fz_math_2d_isect_circle_line_equ_func			fz_math_2d_isect_circle_line_equ;
	fz_math_2d_equ_from_pt_ang_func					fz_math_2d_equ_from_pt_ang;
	fz_math_2d_equs_from_circle_tang_func			fz_math_2d_equs_from_circle_tang;
	fz_math_2d_equ_from_line_pt_ang_func			fz_math_2d_equ_from_line_pt_ang;
	fz_math_2d_dist_pt_line_equ_func				fz_math_2d_dist_pt_line_equ;
	fz_math_2d_dist_pt_line_seg_func				fz_math_2d_dist_pt_line_seg;
	fz_math_2d_bisect_angle_func					fz_math_2d_bisect_angle;
	fz_math_2d_interp_pt_on_line_func				fz_math_2d_interp_pt_on_line;
	fz_math_2d_angle_of_2_lines_func				fz_math_2d_angle_of_2_lines;
	fz_math_2d_reflect_pt_about_pt_func				fz_math_2d_reflect_pt_about_pt;
	fz_math_2d_reflect_pt_about_line_func			fz_math_2d_reflect_pt_about_line;
	fz_math_2d_create_unit_vec_func					fz_math_2d_create_unit_vec;
	fz_math_2d_is_pt_in_polygon_func				fz_math_2d_is_pt_in_polygon;
	fz_math_2d_clip_line_seg_with_polygon_func		fz_math_2d_clip_line_seg_with_polygon;
	fz_math_2d_clip_polygon_with_polygon_func		fz_math_2d_clip_polygon_with_polygon;
	fz_math_2d_cog_of_polygon_func					fz_math_2d_cog_of_polygon;
	fz_math_2d_area_of_polygon_func					fz_math_2d_area_of_polygon;
	fz_math_2d_filter_polygon_pts_func				fz_math_2d_filter_polygon_pts;
	fz_math_2d_xy_mm_to_pnts_func					fz_math_2d_xy_mm_to_pnts;
	
	fz_math_3d_is_zero_len_vec_func					fz_math_3d_is_zero_len_vec;
	fz_math_3d_is_unit_len_vec_func					fz_math_3d_is_unit_len_vec;
	fz_math_3d_is_pt_between_pts_func				fz_math_3d_is_pt_between_pts;
	fz_math_3d_is_parl_equs_func					fz_math_3d_is_parl_equs;
	fz_math_3d_colinear_3_pts_tol_func				fz_math_3d_colinear_3_pts_tol;
	fz_math_3d_colinear_3_pts_func					fz_math_3d_colinear_3_pts;
	fz_math_3d_is_parl_lines_func					fz_math_3d_is_parl_lines;
	fz_math_3d_normalize_vec_func					fz_math_3d_normalize_vec;
	fz_math_3d_cross_prod_func						fz_math_3d_cross_prod;
	fz_math_3d_vec_rotation_xyz_func				fz_math_3d_vec_rotation_xyz;
	fz_math_3d_project_pt_on_line_func				fz_math_3d_project_pt_on_line;
	fz_math_3d_rot_pt_around_line_func				fz_math_3d_rot_pt_around_line;
	fz_math_3d_isect_line_plane_func				fz_math_3d_isect_line_plane;
	fz_math_3d_isect_lines_func						fz_math_3d_isect_lines;
	fz_math_3d_volume_of_tetrahedron_func			fz_math_3d_volume_of_tetrahedron;
	fz_math_3d_equ_from_3_pts_func					fz_math_3d_equ_from_3_pts;
	fz_math_3d_dir_of_3_pts_func					fz_math_3d_dir_of_3_pts;
	fz_math_3d_equal_equs_func						fz_math_3d_equal_equs;
	fz_math_3d_get_proj_plane_func					fz_math_3d_get_proj_plane;
	fz_math_3d_pt_in_proj_plane_func				fz_math_3d_pt_in_proj_plane;
	fz_math_3d_is_pt_on_line_func					fz_math_3d_is_pt_on_line;
	fz_math_3d_isect_3_planes_func					fz_math_3d_isect_3_planes;
	fz_math_3d_project_pt_on_plane_func				fz_math_3d_project_pt_on_plane;
	fz_math_3d_isect_2_planes_func					fz_math_3d_isect_2_planes;
	fz_math_3d_dist_2_lines_func					fz_math_3d_dist_2_lines;
	fz_math_3d_dist_pt_line_func					fz_math_3d_dist_pt_line;
	fz_math_3d_bisect_angle_func					fz_math_3d_bisect_angle;
	fz_math_3d_interp_pt_on_line_func				fz_math_3d_interp_pt_on_line;
	fz_math_3d_angle_of_2_lines_func				fz_math_3d_angle_of_2_lines;
	fz_math_3d_reflect_pt_about_pt_func				fz_math_3d_reflect_pt_about_pt;
	fz_math_3d_reflect_pt_about_line_func			fz_math_3d_reflect_pt_about_line;
	fz_math_3d_reflect_pt_about_plane_func			fz_math_3d_reflect_pt_about_plane;
	fz_math_3d_create_unit_vec_func					fz_math_3d_create_unit_vec;
	fz_math_3d_rot_pt_around_axis_func				fz_math_3d_rot_pt_around_axis;
	fz_math_3d_area_of_3_pts_func					fz_math_3d_area_of_3_pts;
	fz_math_3d_get_3rd_pt_on_plane_func				fz_math_3d_get_3rd_pt_on_plane;
	fz_math_3d_isect_line_sphere_func				fz_math_3d_isect_line_sphere;
	fz_math_3d_isect_line_cube_func					fz_math_3d_isect_line_cube;
	fz_math_3d_cog_of_polygon_func					fz_math_3d_cog_of_polygon;
	fz_math_3d_normal_of_polygon_func				fz_math_3d_normal_of_polygon;
	fz_math_3d_filter_polygon_pts_func				fz_math_3d_filter_polygon_pts;
	fz_math_3d_map_plane_from_pts_func				fz_math_3d_map_plane_from_pts;
	fz_math_3d_map_plane_from_trl_rot_func			fz_math_3d_map_plane_from_trl_rot;
	fz_math_3d_map_plane_from_equc_func				fz_math_3d_map_plane_from_equc;
	fz_math_3d_map_plane_to_world_func				fz_math_3d_map_plane_to_world;
	fz_math_3d_map_plane_to_world_array_func		fz_math_3d_map_plane_to_world_array;
	fz_math_3d_map_plane_to_plane_func				fz_math_3d_map_plane_to_plane;
	fz_math_3d_map_plane_to_plane_array_func		fz_math_3d_map_plane_to_plane_array;
	fz_math_3d_map_plane_get_matrix_func			fz_math_3d_map_plane_get_matrix;
	fz_math_3d_xyz_mm_to_pnts_func					fz_math_3d_xyz_mm_to_pnts;
	
	fz_math_3x3_set_identity_func					fz_math_3x3_set_identity;
	fz_math_3x3_copy_func							fz_math_3x3_copy;
	fz_math_3x3_invert_func							fz_math_3x3_invert;
	fz_math_3x3_is_identity_func					fz_math_3x3_is_identity;
	fz_math_3x3_multiply_mat_mat_func				fz_math_3x3_multiply_mat_mat;
	fz_math_3x3_multiply_mat_xy_func				fz_math_3x3_multiply_mat_xy;
	fz_math_3x3_multiply_mat_xy_array_func			fz_math_3x3_multiply_mat_xy_array;
	fz_math_3x3_multiply_mat_xyz_func				fz_math_3x3_multiply_mat_xyz;
	fz_math_3x3_multiply_mat_xyz_array_func			fz_math_3x3_multiply_mat_xyz_array;
	fz_math_3x3_mat_to_trl_scl_rot_func				fz_math_3x3_mat_to_trl_scl_rot;
	fz_math_3x3_is_uniform_scale_func				fz_math_3x3_is_uniform_scale;
	fz_math_3x3_set_trl_mat_func					fz_math_3x3_set_trl_mat;
	fz_math_3x3_set_rot_mat_func					fz_math_3x3_set_rot_mat;
	fz_math_3x3_set_rot_cntr_mat_func				fz_math_3x3_set_rot_cntr_mat;
	fz_math_3x3_set_scl_mat_func					fz_math_3x3_set_scl_mat;
	fz_math_3x3_set_scl_cntr_mat_func				fz_math_3x3_set_scl_cntr_mat;
	fz_math_3x3_set_refl_mat_func					fz_math_3x3_set_refl_mat;
	fz_math_3x3_multiply_mat_unit_vec_func			fz_math_3x3_multiply_mat_unit_vec;
	fz_math_3x3_solve_func							fz_math_3x3_solve;
	
	fz_math_4x4_is_identity_func					fz_math_4x4_is_identity;
	fz_math_4x4_set_identity_func					fz_math_4x4_set_identity;
	fz_math_4x4_copy_func							fz_math_4x4_copy;
	fz_math_4x4_multiply_mat_mat_func				fz_math_4x4_multiply_mat_mat;
	fz_math_4x4_set_rot_mat_func					fz_math_4x4_set_rot_mat;
	fz_math_4x4_set_scl_mat_func					fz_math_4x4_set_scl_mat;
	fz_math_4x4_set_trl_mat_func					fz_math_4x4_set_trl_mat;
	fz_math_4x4_multiply_mat_xyz_xyzw_func			fz_math_4x4_multiply_mat_xyz_xyzw;
	fz_math_4x4_multiply_mat_xyz_xyzw_array_func	fz_math_4x4_multiply_mat_xyz_xyzw_array;
	fz_math_4x4_multiply_mat_xyzw_func				fz_math_4x4_multiply_mat_xyzw;
	fz_math_4x4_multiply_mat_xyzw_array_func		fz_math_4x4_multiply_mat_xyzw_array;
	fz_math_4x4_multiply_mat_xyz_func				fz_math_4x4_multiply_mat_xyz;
	fz_math_4x4_multiply_mat_xyz_array_func			fz_math_4x4_multiply_mat_xyz_array;
	fz_math_4x4_multiply_mat_unit_vec_func			fz_math_4x4_multiply_mat_unit_vec;
	fz_math_4x4_multiply_mat_xy_func				fz_math_4x4_multiply_mat_xy;
	fz_math_4x4_multiply_mat_xy_array_func			fz_math_4x4_multiply_mat_xy_array;
	fz_math_4x4_set_scl_cntr_mat_func				fz_math_4x4_set_scl_cntr_mat;
	fz_math_4x4_set_rot_cntr_mat_func				fz_math_4x4_set_rot_cntr_mat;
	fz_math_4x4_set_refl_mat_func					fz_math_4x4_set_refl_mat;
	fz_math_4x4_mat_to_trl_scl_rot_func				fz_math_4x4_mat_to_trl_scl_rot;
	fz_math_4x4_is_uniform_scale_func				fz_math_4x4_is_uniform_scale;
	fz_math_4x4_mat_from_trl_scl_rot_func			fz_math_4x4_mat_from_trl_scl_rot;
	fz_math_4x4_invert_func							fz_math_4x4_invert;
	fz_math_4x4_solve_func							fz_math_4x4_solve;
	
	fz_math_4x4_set_refl_plane_mat_func				fz_math_4x4_set_refl_plane_mat;
	fz_math_4x4_set_refl_line_mat_func				fz_math_4x4_set_refl_line_mat;
	fz_math_4x4_set_refl_pt_mat_func				fz_math_4x4_set_refl_pt_mat;

	fz_math_3d_xyz_rotation_vec_func				fz_math_3d_xyz_rotation_vec;
	fz_math_3x3_mat_field_set_func					fz_math_3x3_mat_field_set;
	fz_math_3x3_mat_field_get_func					fz_math_3x3_mat_field_get;
	fz_math_4x4_mat_field_set_func					fz_math_4x4_mat_field_set;
	fz_math_4x4_mat_field_get_func					fz_math_4x4_mat_field_get;


	fz_math_3x3_mat_from_trl_scl_rot_func			fz_math_3x3_mat_from_trl_scl_rot;
	fz_math_2d_is_pt_on_polygon_func				fz_math_2d_is_pt_on_polygon;
	fz_math_3d_isect_line_cone_func					fz_math_3d_isect_line_cone;
	
	

	fz_math_3d_map_plane_to_equc_func				fz_math_3d_map_plane_to_equc;
	
	
	fz_math_3d_isect_line_cyln_func					fz_math_3d_isect_line_cyln;

}	fz_math_fset;


#ifdef __cplusplus
}
#endif

#endif
