C# Class NPlot.Utils

General purpose utility functions used internally.
Afficher le fichier Open project: GridProtectionAlliance/openHistorian

Méthodes publiques

Méthode Description
ArrayMinMax ( IList a, double &min, double &max ) : bool

Returns the minimum and maximum values in an IList. The members of the list can be of different types - any type for which the function Utils.ConvertToDouble knows how to convert into a double.

Distance ( PointF a, PointF b ) : float

Calculate the distance between two points, a and b.

Distance ( Point a, Point b ) : int

Calculate the distance between two points, a and b.

DoubleEqual ( double a, double b ) : bool

Returns true if the absolute difference between parameters is less than Epsilon

ScaleFont ( Font initial, double scale ) : Font

Get a Font exactly the same as the passed in one, except for scale factor.

Swap ( double &a, double &b ) : void

Swaps the value of two doubles.

UnitVector ( PointF a, PointF b ) : PointF

Returns unit vector along the line a->b.

Method Details

ArrayMinMax() public static méthode

Returns the minimum and maximum values in an IList. The members of the list can be of different types - any type for which the function Utils.ConvertToDouble knows how to convert into a double.
public static ArrayMinMax ( IList a, double &min, double &max ) : bool
a IList The IList to search.
min double The minimum value.
max double The maximum value.
Résultat bool

Distance() public static méthode

Calculate the distance between two points, a and b.
public static Distance ( PointF a, PointF b ) : float
a System.Drawing.PointF First point
b System.Drawing.PointF Second point
Résultat float

Distance() public static méthode

Calculate the distance between two points, a and b.
public static Distance ( Point a, Point b ) : int
a Point First point
b Point Second point
Résultat int

DoubleEqual() public static méthode

Returns true if the absolute difference between parameters is less than Epsilon
public static DoubleEqual ( double a, double b ) : bool
a double first number to compare
b double second number to compare
Résultat bool

ScaleFont() public static méthode

Get a Font exactly the same as the passed in one, except for scale factor.
public static ScaleFont ( Font initial, double scale ) : Font
initial System.Drawing.Font The font to scale.
scale double Scale by this factor.
Résultat System.Drawing.Font

Swap() public static méthode

Swaps the value of two doubles.
public static Swap ( double &a, double &b ) : void
a double first value to swap.
b double second value to swap.
Résultat void

UnitVector() public static méthode

Returns unit vector along the line a->b.
public static UnitVector ( PointF a, PointF b ) : PointF
a System.Drawing.PointF line start point.
b System.Drawing.PointF line end point.
Résultat System.Drawing.PointF