Package Maths

Package with simple mathimatical Funktions

Class Math

Simple mathematical Functions

Operations

public Graphics.Points.Point Add_Vector ( Graphics.Points.Point Point , Graphics.Area_Sizes.Area_Size Vector );

adds a vector to a point

public Graphics.Points.Point Add_Vector ( Graphics.Points.Point Point , Graphics.Area_Sizes.Area_Size Vector , Glib.Gfloat Factor );

adds a vector to a point

public Graphics.Area_Sizes.Area_Size Difference ( Graphics.Points.Point Point1 , Graphics.Points.Point Point2 );

returns the difference between two Points: Point1 - Point2

public Glib.Gint Distance ( Graphics.Area_Sizes.Area_Size Vector );

2-Norm of Vector

public Graphics.Points.Point Sub_Vector ( Graphics.Points.Point Point , Graphics.Area_Sizes.Area_Size Vector );

subtracts a vector from a point

public Graphics.Points.Point Sub_Vector ( Graphics.Points.Point Point , Graphics.Area_Sizes.Area_Size Vector , Glib.Gfloat Factor );

subtracts a vector from a point

public Glib.Gint Sqr ( Glib.Gint x );

returns square of x

public Float Sqr ( Float x );

returns square of x

public Glib.Gint Sign ( Glib.Gint X );

returns 1 if X>0, 0 if X=0 and -1 else

public Boolean Is_In_Area ( Graphics.Points.Point Point , Graphics.Points.Point Area_Point_1 , Graphics.Points.Point Area_Point_2 );

returns true if the first Point is in the area (given by the second and third point)

public Glib.Gint Safe_Div ( Glib.Gint X , Glib.Gint Y );

returns 0 if Y=0, and otherwise X div Y

public Graphics.Area_Sizes.Area_Size To_Vector ( Graphics.Points.Point Pos );

Converts a Point into a vector (Area_Size): Width = X, Height = Y. It means that it will generate a Area between Zero_Point and Pos.

public Graphics.Points.Point To_Point ( Graphics.Area_Sizes.Area_Size Vector );

Converts a vector (Area_Size) into a Point: X = Width, Y = Heigth.

public Boolean Cohen_Sutherland ( Graphics.Points.Point P_Start , Graphics.Points.Point P_End , Graphics.Points.Point Up_Left , Graphics.Points.Point Low_Right );

returns true if parts of the edge are in the visible area; else false

public Cohen_Sutherland ( Graphics.Points.Point P_Start , Graphics.Points.Point P_End , Graphics.Points.Point Up_Left , Graphics.Points.Point Low_Right , Boolean Is_Drawn );