Graph Maker
|
Static utility class for performing miscellaneous functions such as data generation functions. More...
Static Public Member Functions | |
static float | RemapFloat (float val, float start1, float end1, float start2, float end2) |
Remaps the value of a float from one range to another range. More... | |
static Vector2 | RemapVec2 (float val, float start1, float end1, Vector2 start2, Vector2 end2) |
Remaps a float value to a Vector2 using a source float range and target Vector2 range. More... | |
static Sprite | createSprite (int x, int y) |
static Texture2D | createTexture (int x, int y) |
static void | listChanged< T > (bool editorChange, ref WMG_List< T > w_list, ref List< T > list, bool oneValChanged, int index) |
static void | updateCacheAndFlag< T > (ref T cache, T val, ref bool flag) |
Update the value of a cached value, and set bool flag to true if the cache was different. More... | |
static void | updateCacheAndFlagList< T > (ref List< T > cache, List< T > val, ref bool flag) |
Cache the values of a list, and set bool flag to true if the cache was different. More... | |
static void | SwapVals< T > (ref T val1, ref T val2) |
Swaps one value with another value. More... | |
static void | SwapValsList< T > (ref List< T > val1, ref List< T > val2) |
Swaps one list with another list. More... | |
static List< Vector2 > | GenLinear (int numPoints, float minX, float maxX, float a, float b) |
Generate data of the form Y = aX + b More... | |
static List< Vector2 > | GenQuadratic (int numPoints, float minX, float maxX, float a, float b, float c) |
Generate data of the form Y = aX^2 + bX + c More... | |
static List< Vector2 > | GenExponential (int numPoints, float minX, float maxX, float a, float b, float c) |
Generate data of the form Y = ab^X + c More... | |
static List< Vector2 > | GenLogarithmic (int numPoints, float minX, float maxX, float a, float b, float c) |
Generate data of the form Y = a * log base b of X + c More... | |
static List< Vector2 > | GenCircular (int numPoints, float a, float b, float c, float degreeOffset=0) |
Generate data of the form c^2 = (X - a)^2 * (Y - b)^2. More... | |
static List< Vector2 > | GenRadar (List< float > data, float a, float b, float degreeOffset) |
Generates a list of Vector2 used in a Radar graph. More... | |
static List< Vector2 > | GenRandomXY (int numPoints, float minX, float maxX, float minY, float maxY) |
Generates a list of Vector2 where both x and y are random. More... | |
static List< Vector2 > | GenRandomY (int numPoints, float minX, float maxX, float minY, float maxY) |
Generates a list of Vector2 where x increases uniformly and y is random. More... | |
static List< float > | GenRandomList (int numPoints, float min, float max) |
Generates a list of random values. More... | |
static void | updateBandColors (ref Color[] colors, float maxSize, float inner, float outer, bool antiAliasing, float antiAliasingStrength, Color[] orig=null) |
For filling texture based on a circular band (e.g. More... | |
static bool | LineIntersectsCircle (float x0, float y0, float x1, float y1, float x2, float y2, float r) |
Returns true if a line segment intersect a circle. More... | |
static bool | LineSegmentsIntersect (float p1x, float p1y, float p2x, float p2y, float p3x, float p3y, float p4x, float p4y) |
Returns true if line segment (p1x,p1y) - (p2x,p2y) intersects line segment (p3x,p3y) - (p4x,p4y) More... | |
static string | FormatValueLabel (string text, WMG_Enums.labelTypes labelType, float value, float percent, int numDecimals) |
Returns a string given an input string / input float and some formatting options. More... | |
static Vector2 | ExpressionEvaluator (List< string > rpnString, float x) |
Evaluate arbitrary expression of the form (y = ...) for a given input value of x (expression doesn't have to have an x). More... | |
static List< string > | ShuntingYardAlgorithm (string input) |
Convert space delimited infix expression string to reverse polish notation More... | |
Static utility class for performing miscellaneous functions such as data generation functions.
|
static |
|
static |
|
static |
Evaluate arbitrary expression of the form (y = ...) for a given input value of x (expression doesn't have to have an x).
Input expression must be in reverse polish notation with each token of the expression put in a List<string>
rpnString | Reverse Polish Notation (RPN) string. |
x | The x coordinate. |
|
static |
Returns a string given an input string / input float and some formatting options.
text | Text. |
labelType | Label type. |
value | Value. |
percent | Percent. |
numDecimals | Number decimals. |
|
static |
Generate data of the form c^2 = (X - a)^2 * (Y - b)^2.
Can be used to generate shapes as well (e.g. 3 points for triangle).
numPoints | Number points. |
a | The alpha component. |
b | The blue component. |
c | C. |
degreeOffset | Degree offset. |
|
static |
Generate data of the form Y = ab^X + c
numPoints | Number points. |
minX | Minimum x. |
maxX | Max x. |
a | The alpha component. |
b | The blue component. |
c | C. |
|
static |
Generate data of the form Y = aX + b
numPoints | Number points. |
minX | Minimum x. |
maxX | Max x. |
a | The alpha component. |
b | The blue component. |
|
static |
Generate data of the form Y = a * log base b of X + c
numPoints | Number points. |
minX | Minimum x. |
maxX | Max x. |
a | The alpha component. |
b | The blue component. |
c | C. |
|
static |
Generate data of the form Y = aX^2 + bX + c
numPoints | Number points. |
minX | Minimum x. |
maxX | Max x. |
a | The alpha component. |
b | The blue component. |
c | C. |
|
static |
Generates a list of Vector2 used in a Radar graph.
data | Data. |
a | The alpha component. |
b | The blue component. |
degreeOffset | Degree offset. |
|
static |
Generates a list of random values.
numPoints | Number points. |
min | Minimum. |
max | Max. |
|
static |
Generates a list of Vector2 where both x and y are random.
numPoints | Number points. |
minX | Minimum x. |
maxX | Max x. |
minY | Minimum y. |
maxY | Max y. |
|
static |
Generates a list of Vector2 where x increases uniformly and y is random.
numPoints | Number points. |
minX | Minimum x. |
maxX | Max x. |
minY | Minimum y. |
maxY | Max y. |
|
static |
Returns true if a line segment intersect a circle.
Line segment is (x0, y0) to (x1, y1). Circle is centered at (x2, y2) with radius r
true
, if circle and line intersect, false
otherwise.x0 | X0. |
y0 | Y0. |
x1 | The first x value. |
y1 | The first y value. |
x2 | The second x value. |
y2 | The second y value. |
r | The red component. |
|
static |
Returns true if line segment (p1x,p1y) - (p2x,p2y) intersects line segment (p3x,p3y) - (p4x,p4y)
true
, if line and line intersect, false
otherwise.p1x | P1x. |
p1y | P1y. |
p2x | P2x. |
p2y | P2y. |
p3x | P3x. |
p3y | P3y. |
p4x | P4x. |
p4y | P4y. |
|
static |
|
static |
Remaps the value of a float from one range to another range.
val | Value. |
start1 | Start1. |
end1 | End1. |
start2 | Start2. |
end2 | End2. |
|
static |
Remaps a float value to a Vector2 using a source float range and target Vector2 range.
val | Value. |
start1 | Start1. |
end1 | End1. |
start2 | Start2. |
end2 | End2. |
|
static |
Convert space delimited infix expression string to reverse polish notation
input | Input. |
|
static |
Swaps one value with another value.
val1 | Val1. |
val2 | Val2. |
T | The 1st type parameter. |
|
static |
Swaps one list with another list.
val1 | Val1. |
val2 | Val2. |
T | The 1st type parameter. |
|
static |
For filling texture based on a circular band (e.g.
doughnut defined by inner and outer radii)
colors | Colors. |
maxSize | Max size. |
inner | Inner. |
outer | Outer. |
antiAliasing | If set to true anti aliasing. |
antiAliasingStrength | Anti aliasing strength. |
orig | Original. |
|
static |
Update the value of a cached value, and set bool flag to true if the cache was different.
cache | Cache. |
val | Value. |
flag | Flag. |
T | The 1st type parameter. |
|
static |
Cache the values of a list, and set bool flag to true if the cache was different.
cache | Cache. |
val | Value. |
flag | Flag. |
T | The 1st type parameter. |