C# Class Revit.SDK.Samples.CreateBeamSystem.CS.MathUtil

utility class contains some methods deal with some general arithmetic
显示文件 Open project: AMEE/revit

Public Methods

Method Description
Add ( PointF f1, PointF f2 ) : PointF

add 2 vector

CompareDouble ( double d1, double d2 ) : bool

compare whether 2 double is equal using internal precision

Dot ( PointF pnt1, PointF pnt2 ) : float

dot multiply two vector

FindIntersection ( float u0, float u1, float v0, float v1, float &w ) : int

find and calculate the intersection of two interval [u0, u1] and [v0, v1]

GetMax ( float f1, float f2 ) : float

get the maximum value of 2 float

GetMin ( float f1, float f2 ) : float

get the minimum value of 2 float

Multiply ( float f, PointF pnt ) : PointF

multiply a float with a vector

Subtract ( PointF f1, PointF f2 ) : PointF

subtract 2 vector

Private Methods

Method Description
MathUtil ( ) : System

forbidden default constructor

Method Details

Add() public static method

add 2 vector
public static Add ( PointF f1, PointF f2 ) : PointF
f1 System.Drawing.PointF first vector
f2 System.Drawing.PointF second vector
return System.Drawing.PointF

CompareDouble() public static method

compare whether 2 double is equal using internal precision
public static CompareDouble ( double d1, double d2 ) : bool
d1 double first value
d2 double second value
return bool

Dot() public static method

dot multiply two vector
public static Dot ( PointF pnt1, PointF pnt2 ) : float
pnt1 System.Drawing.PointF first vector
pnt2 System.Drawing.PointF second vector
return float

FindIntersection() public static method

find and calculate the intersection of two interval [u0, u1] and [v0, v1]
public static FindIntersection ( float u0, float u1, float v0, float v1, float &w ) : int
u0 float first interval
u1 float first interval
v0 float second interval
v1 float second interval
w float 2 intersections
return int

GetMax() public static method

get the maximum value of 2 float
public static GetMax ( float f1, float f2 ) : float
f1 float first float
f2 float second float
return float

GetMin() public static method

get the minimum value of 2 float
public static GetMin ( float f1, float f2 ) : float
f1 float first float
f2 float second float
return float

Multiply() public static method

multiply a float with a vector
public static Multiply ( float f, PointF pnt ) : PointF
f float float value
pnt System.Drawing.PointF vector
return System.Drawing.PointF

Subtract() public static method

subtract 2 vector
public static Subtract ( PointF f1, PointF f2 ) : PointF
f1 System.Drawing.PointF first vector
f2 System.Drawing.PointF second vector
return System.Drawing.PointF