class GeometryXD
package geometryxd
GeometryXD - multidimensional geometry manipulations. Primarily targeted for 3D objects (points, vectors, curves).
Additional methods allow manipulate with arrays.
Convert arrays. Int <-> Float <-> String <-> Int Arrays.
Sum arrays. Parallel sum of arrays elements.
Diff arrays. Parallel diff of arrays elements from first array elements.
Multiplying arrays. Parallel multiplication of arrays elements.
Sum array elements.
Calculate max abs value from Float Array.
Not pro level library.
Static methods
staticinlinepositive_inside_I (a:Array<Int>):Bool
return true if incoming Int Array have at least one positive element
Parameters:
a |
|
---|
staticinlinezero_inside_I (a:Array<Int>):Bool
return true if incoming Int Array have at least one zero element
Parameters:
a |
|
---|
staticinlinenegative_inside_I (a:Array<Int>):Bool
return true if incoming Int Array have at least one negative element
Parameters:
a |
|
---|
staticinlinepositive_inside_F (a:Array<Float>):Bool
return true if incoming Float Array have at least one positive element
Parameters:
a |
|
---|
staticinlinezero_inside_F (a:Array<Float>):Bool
return true if incoming Float Array have at least one zero element
Parameters:
a |
|
---|
staticinlinenegative_inside_F (a:Array<Float>):Bool
return true if incoming Float Array have at least one negative element
Parameters:
a |
|
---|
staticinlinesame_size_I (a:Array<Array<Int>>):Null<Bool>
return true if Int Arrays have same size
Parameters:
a |
|
---|
staticinlinesame_size_F (a:Array<Array<Float>>):Null<Bool>
return true if Float Arrays have same size
Parameters:
a |
|
---|
staticsame_xI (a:Array<Array<Int>>):Null<Bool>
compare Int Arrays. Returns true if all arrays have equal data
Parameters:
a |
|
---|
staticsame_xF (a:Array<Array<Float>>):Null<Bool>
compare Float Arrays. Returns true if all arrays have equal data
Parameters:
a |
|
---|
staticinlinesum_I (a:Array<Int>):Null<Int>
returns sum of Int Array elements. [1,2,3] -> 6. tested
Parameters:
a |
|
---|
staticinlinesum_F (a:Array<Float>):Null<Float>
returns sum of Float Array elements. [1.1,2,3] -> 6.1. tested
Parameters:
a |
|
---|
staticdiff_I (a:Array<Int>):Null<Int>
returns diff between first and others Int Array elements. [1,2,3] -> -4. tested
Parameters:
a |
|
---|
staticdiff_F (a:Array<Float>):Null<Float>
returns diff between first and others Float Array elements. [1.1,2,3] -> -3.9. tested
Parameters:
a |
|
---|
staticmiddle_F (a:Array<Float>):Null<Float>
returns middle value of Float Array
Parameters:
a |
|
---|
staticinlinemultiply_I_I (a:Array<Int>, n:Int):Array<Int>
multiplies each element of an Int Array by Int
Parameters:
a |
|
---|---|
n |
|
staticinlinemultiply_F_F (a:Array<Float>, n:Float):Array<Float>
multiplies each element of an Float Array by Float
Parameters:
a |
|
---|---|
n |
|
staticinlinemultiply_I (a:Array<Int>):Null<Int>
multiplies all elements of an Int Array. [1, 2, 3] return 1 * 2 * 3
Parameters:
a |
|
---|
staticinlinemultiply_F (a:Array<Float>):Null<Float>
multiplies all elements of an Float Array. [1.1, 2.0, 3.0] return 1.1 * 2.0 * 3.0
Parameters:
a |
|
---|
staticinlineminus_I (a:Array<Int>):Array<Int>
multiplies each element of the Int Array by -1
Parameters:
a |
|
---|
staticinlineminus_F (a:Array<Float>):Array<Float>
multiplies each element of the Float Array by -1
Parameters:
a |
|
---|
staticsum_xI (a:Array<Array<Int>>):Array<Int>
return Int Array which is Int Arrays sum. [[1, 2, 3], [-3, -2, -1]] return [-2, 0, 2]
Parameters:
a |
|
---|
staticsum_xF (a:Array<Array<Float>>):Array<Float>
return Float Array which is Float Arrays sum. [[1.1, 2, 3], [-3, -2, -1]] return [-1.9, 0, 2]
Parameters:
a |
|
---|
staticdiff_xI (a:Array<Array<Int>>):Array<Int>
return Int Array which is result of diff between first Int Array and others. [[1, 2, 3], [-3, -2, -1]] return [4, 4, 4]
Parameters:
a |
|
---|
staticdiff_xF (a:Array<Array<Float>>):Array<Float>
return Float Array which is result of diff between first Float Array and others. [[1.1, 2, 3], [-3, -2, -1]] return [4.1, 4, 4]
Parameters:
a |
|
---|
staticmiddle_xF (a:Array<Array<Float>>):Array<Float>
return Float Array with middle values from arrays. [[1.1, 2, 3], [-3, -2, -1]] return [(1.1 - 3) / 2, (2 - 2) / 2, (3 - 1) / 2]
Parameters:
a |
|
---|
staticmultiply_xI_I (a:Array<Array<Int>>, n:Int):Array<Array<Int>>
return Int arrays which is result of multiplying each element by Int
Parameters:
a |
|
---|---|
n |
|
staticmultiply_xF_F (a:Array<Array<Float>>, n:Float):Array<Array<Float>>
return Float arrays which is result of multiplying each element by Float
Parameters:
a |
|
---|---|
n |
|
staticmultiply_xI (a:Array<Array<Int>>):Array<Int>
return Int Array which is result of multiplying arrays. [[1, 2], [3, 4]] return [1 * 3, 2 * 4]
Parameters:
a |
|
---|
staticmultiply_xF (a:Array<Array<Float>>):Array<Float>
return Float Array which is result of multiplying arrays. [[3.1, 2], [3, 4]] return [3.1 * 3, 2 * 4]
Parameters:
a |
|
---|
staticmultisum_xI (a:Array<Array<Int>>):Null<Int>
Int Arrays bonus function. Short form of sum_I(multiply_xI(a)). [[a, b], [c, d]] return a * c + b * d
Parameters:
a |
|
---|
staticmultisum_xF (a:Array<Array<Float>>):Null<Float>
Float Arrays bonus function. Short form of sum_F(multiply_xF(a)). [[a, b], [c, d]] return a * c + b * d
Parameters:
a |
|
---|
staticinlinesum_previous_I (a:Array<Int>):Array<Int>
return Int Array which is result of sum with previous element. [1, 2, 3] return [1, 3, 5]
Parameters:
a |
|
---|
staticinlinediff_previous_I (a:Array<Int>):Array<Int>
return Int Array which is result of diff with previous element. [1, 2, 3] return [1, 1, 1]
Parameters:
a |
|
---|
staticinlinesum_before_I (a:Array<Int>):Array<Int>
return Int Array which is result of sum each element with before elements sum. [1, 2, 3] return [1, 3, 6]
Parameters:
a |
|
---|
staticinlinediff_before_I (a:Array<Int>):Array<Int>
return Int Array which is result of diff each element with before elements diff. [1, 2, 3] return [1, 1, 2]
Parameters:
a |
|
---|
staticinlinesum_previous_F (a:Array<Float>):Array<Float>
return Float Array which is result of sum with previous element. [1.1, 2, 3] return [1.1, 3.1, 5]
Parameters:
a |
|
---|
staticinlinediff_previous_F (a:Array<Float>):Array<Float>
return Float Array which is result of diff with previous element. [1.1, 2, 3] return [1.1, 0.9, 1]
Parameters:
a |
|
---|
staticinlinesum_before_F (a:Array<Float>):Array<Float>
return Float Array which is result of sum each element with before elements sum. [1.1, 2, 3] return [1.1, 3.1, 6.1]
Parameters:
a |
|
---|
staticinlinediff_before_F (a:Array<Float>):Array<Float>
return Float Array which is result of diff each element with before elements diff. [1.1, 2, 3] return [1.1, 0.9, 2.1]
Parameters:
a |
|
---|
staticinlinerecounter_I_F (what:Array<Int>):Array<Float>
recount Int Array to Float Array
Parameters:
what |
|
---|
staticinlinerecounter_F_I (what:Array<Float>):Array<Int>
recount Float Array to Int Array
Parameters:
what |
|
---|
staticinlinerecounter_I_S (what:Array<Int>):Array<String>
recount Int Array to String Array
Parameters:
what |
|
---|
staticinlinerecounter_F_S (what:Array<Float>):Array<String>
recount Float Array to String Array
Parameters:
what |
|
---|
staticinlinerecounter_S_I (what:Array<String>):Array<Int>
recount String Array to Int Array
Parameters:
what |
|
---|
staticinlinerecounter_S_F (what:Array<String>):Array<Float>
recount String Array to Float Array
Parameters:
what |
|
---|
staticinlinerepeater_F_F (n:Int, what:Array<Float>, full:Bool = false):Array<Float>
repeat Float Array to specified length
Parameters:
n |
|
---|---|
what |
|
full |
|
staticinlinerepeater_I_I (n:Int, what:Array<Int>, full:Bool = false):Array<Int>
repeat Int Array to specified length
Parameters:
n |
|
---|---|
what |
|
full |
|
staticinlinerepeater_S_S (n:Int, what:Array<String>, full:Bool = false):Array<String>
repeat String Array to specified length
Parameters:
n |
|
---|---|
what |
|
full |
|
staticrepeater_F_I (n:Int, what_:Array<Float>, full:Bool = false):Array<Int>
repeat Float Array to specified length Int Array
Parameters:
n |
|
---|---|
what |
|
full |
|
staticrepeater_S_I (n:Int, what_:Array<String>, full:Bool = false):Array<Int>
repeat String Array to specified length Int Array
Parameters:
n |
|
---|---|
what |
|
full |
|
staticrepeater_I_F (n:Int, what_:Array<Int>, full:Bool = false):Array<Float>
repeat Int Array to specified length Float Array
Parameters:
n |
|
---|---|
what |
|
full |
|
staticrepeater_S_F (n:Int, what_:Array<String>, full:Bool = false):Array<Float>
repeat String Array to specified length Float Array
Parameters:
n |
|
---|---|
what |
|
full |
|
staticrepeater_I_S (n:Int, what_:Array<Int>, full:Bool = false):Array<String>
repeat Int Array to specified length String Array
Parameters:
n |
|
---|---|
what |
|
full |
|
staticrepeater_F_S (n:Int, what_:Array<Float>, full:Bool = false):Array<String>
repeat Float Array to specified length String Array
Parameters:
n |
|
---|---|
what |
|
full |
|
staticinlinean_in_b_S (a:Array<String>, b:Array<String>):Array<Array<Int>>
return array of arrays with pair indexes which is indexes equivalent elements of a and b arrays. a=["1", "2"] b=["1", "2", "1"] return [[0, 0], [0, 2], [1, 1]]
Parameters:
a |
|
---|---|
b |
|
staticinlinean_in_bn_S (a:Array<String>, b:Array<Array<String>>):Array<Array<Int>>
return array of arrays with pair indexes which is indexes equivalent elements of a and b arrays. a=["1", "2"] b=[["1", "2", "1"],["0", "2"]] return [[0, 0, 0], [0, 0, 2], [1, 0, 1], [1, 1, 1]]. where indexes [1, 0, 1] = [1(a), 0(b), 1(b[0])]
Parameters:
a |
|
---|---|
b |
|
staticinlinean_in_b_I (a:Array<Int>, b:Array<Int>):Array<Array<Int>>
return array of arrays with pair indexes which is indexes equivalent elements of a and b arrays. a=[1, 2] b=[1, 2, 1] return [[0, 0], [0, 2], [1, 1]]
Parameters:
a |
|
---|---|
b |
|
staticinlinean_in_bn_I (a:Array<Int>, b:Array<Array<Int>>):Array<Array<Int>>
return array of arrays with pair indexes which is indexes equivalent elements of a and b arrays. a=[1, 2] b=[[1, 2, 1],[0, 2]] return [[0, 0, 0], [0, 0, 2], [1, 0, 1], [1, 1, 1]]. where indexes [1, 0, 1] = [1(a), 0(b), 1(b[0])]
Parameters:
a |
|
---|---|
b |
|
staticinlinean_in_b_F (a:Array<Float>, b:Array<Float>):Array<Array<Int>>
return array of arrays with pair indexes which is indexes equivalent elements of a and b arrays. a=[1.0, 2.0] b=[1.0, 2.0, 1.0] return [[0, 0], [0, 2], [1, 1]]
Parameters:
a |
|
---|---|
b |
|
staticinlinean_in_bn_F (a:Array<Float>, b:Array<Array<Float>>):Array<Array<Int>>
return array of arrays with pair indexes which is indexes equivalent elements of a and b arrays. a=[1.0, 2.0] b=[[1.0, 2.0, 1.0],[0, 2.0]] return [[0, 0, 0], [0, 0, 2], [1, 0, 1], [1, 1, 1]]. where indexes [1, 0, 1] = [1(a), 0(b), 1(b[0])]
Parameters:
a |
|
---|---|
b |
|
staticchain_indexes (a_l:Int, n:Int, ring:Bool):Array<Array<Int>>
chain bonus function. split range to sequences specified length n with same border values. f(6, 3, false) return [[0, 1, 2], [2, 3, 4]]. But f(6, 3, true) return [[0, 1, 2], [2, 3, 4], [4, 5, 0]]. Can be used to split dotsXDfield (array of 3D dots) to array of separated 4dots curves trajectories which have same border dots. Just split array of dots length a_l to n = 4. Then recount to beziercurves or create multidot curve use each last three dots.
Parameters:
a_l |
|
---|---|
n |
|
ring |
|
staticinlinechain_S (a:Array<String>, n:Int, ring:Bool = false):Array<Array<String>>
create chain from String Array. Sequences with same border values
Parameters:
a |
|
---|---|
n |
|
ring |
|
staticinlinechain_I (a:Array<Int>, n:Int, ring:Bool = false):Array<Array<Int>>
create chain from Int Array. Sequences with same border values
Parameters:
a |
|
---|---|
n |
|
ring |
|
staticinlinechain_F (a:Array<Float>, n:Int, ring:Bool = false):Array<Array<Float>>
create chain from Float Array. Sequences with same border values
Parameters:
a |
|
---|---|
n |
|
ring |
|
staticinlinesteps_internal (xmin:Float, xmax:Float, n:Int, borders:Bool = false):Array<Float>
split interval to equal steps
Parameters:
xmin |
|
---|---|
xmax |
|
n |
|
borders |
|
staticsteps_external (smin:Float, smax:Float, n:Int, direction:Int):Array<Float>
repeat step multiple times. f(1, 5, 3, -1) return [-11, -7, -3, 1, 5] f(1, 5, 3, 0) return [-11, -7, -3, 1, 5, 9, 13, 17] f(1, 5, 3, 1) return [1, 5, 9, 13, 17]
Parameters:
smin |
|
---|---|
smax |
|
n |
|
direction |
|
staticinlinesign_I (x:Int):Int
return sign of Int. if x < 0 return -1, else return 1.
Parameters:
x |
|
---|
staticinlinesign_F (x:Float):Int
return sign of Float. if x < 0 return -1, else return 1.
Parameters:
x |
|
---|
staticinlinesign3_I (x:Int):Int
return sign of Int or 0. if x < 0 return -1, if x > 0 return 1, if x == 0 return 0.
Parameters:
x |
|
---|
staticinlinesign3_F (x:Float):Int
return sign of Float or 0. if x < 0 return -1, if x > 0 return 1, if x == 0 return 0.
Parameters:
x |
|
---|
staticinlinesin_cos_cut (x:Float):Float
sin cos bonus function. Normalise sin cos, counted use vectors to -1...1 include boders. Need because sometimes (detected on python3 in the past) result of calculating sin cos uses vectors can be more then 1, or less then -1. For example 1.00000000001 etc. Just tiny correction, just for case.
Parameters:
x |
|
---|
staticinlinedegrees (angle:Float):Float
convert radians angle to degrees angle value
Parameters:
angle |
|
---|
staticinlineradians (angle:Float):Float
convert degrees angle to radians angle value
Parameters:
angle |
|
---|
staticangle_quadrant (angle:Float, rad:Bool = false):Int
return the quadrant of any angle. 0 angle return 4 quadrant. For example use degrees: ... 0 < angle <= 90 return 1 quadrant ... 90 < angle <= 180 return 2 quadrant ... 180 < angle <= 270 return 3 quadrant ... 270 < angle <= 360 return 4 quadrant
Parameters:
angle |
|
---|---|
rad |
|
staticvecXDnorm (vecXD:Array<Float>):Float
return vector length (other names "norm" or "magnitude"). For [2,3] return Math.sqrt((2 * 2) + (3 * 3))
Parameters:
vecXD |
|
---|
staticinlinevecXDfieldnorm (vecXDfield:Array<Array<Float>>):Array<Float>
return array of lengths of vectors
Parameters:
vecXDfield |
|
---|
staticmaxabs (a:Array<Float>):Float
return Float Array element with maximum absolute value with sign. Each element compared as abs(element). [1, 2, -4] return -4.
Parameters:
a |
|
---|
staticvecXD (dotXDa:Array<Float>, dotXDb:Array<Float>):Array<Float>
return vector builded uses two dots
Parameters:
dotXDa |
|
---|---|
dotXDb |
|
staticvecXDone (vecXD:Array<Float>):Array<Float>
recount vector to length equal 1
Parameters:
vecXD |
|
---|
staticvecXDfield (dots:Array<Array<Float>>):Array<Array<Float>>
return vector field from first dot to each other
Parameters:
dots |
|
---|
staticinlinevecXDsame (vecXDa:Array<Float>, vecXDb:Array<Float>):Null<Bool>
compare vectors. Returns true if vectors have equal data
Parameters:
vecXDa |
|
---|---|
vecXDb |
|
staticinlinevecXDfieldsame (vecXDfield:Array<Array<Float>>):Null<Bool>
compare vectors from vector field. Returns true if all vectors have same data
Parameters:
vecXDfield |
|
---|
staticvecXDrandom (x:Int = 3):Array<Float>
return random vector with length equal 1
Parameters:
x |
|
---|
staticvecXDsum (vecXDa:Array<Float>, vecXDb:Array<Float>):Array<Float>
return vector, which is sum of two vectors
Parameters:
vecXDa |
|
---|---|
vecXDb |
|
staticvecXDfieldsum (vecXDfield:Array<Array<Float>>):Array<Float>
return vector, which is sum of vector field
Parameters:
vecXDfield |
|
---|
staticvecXDdiff (vecXDa:Array<Float>, vecXDb:Array<Float>):Array<Float>
return vector, which is diff of vectors. vecXDa - vecXDb
Parameters:
vecXDa |
|
---|---|
vecXDb |
|
staticvecXDfielddiff (vecXDfield:Array<Array<Float>>):Array<Float>
return vector, which is diff of vector field. v0-v1...-vn
Parameters:
vecXDfield |
|
---|
staticvecXDback (vecXD:Array<Float>):Array<Float>
return opposite vector. [1, 2, -4] return [-1, -2, 4]
Parameters:
vecXD |
|
---|
staticvecXDfieldback (vecXDfield:Array<Array<Float>>):Array<Array<Float>>
return opposite vector field. [[1, 2], [3, -4]] return [[-1, -2], [-3, 4]]
Parameters:
vecXDfield |
|
---|
staticvecXDparalleled_sameside (vecXDa:Array<Float>, vecXDb:Array<Float>):Null<Bool>
return true if vectors paralleled and have same direction
Parameters:
vecXDa |
|
---|---|
vecXDb |
|
staticvecXDparalleled_opposite (vecXDa:Array<Float>, vecXDb:Array<Float>):Null<Bool>
return true if vectors paralleled and have opposite direction
Parameters:
vecXDa |
|
---|---|
vecXDb |
|
staticvecXDparalleled (vecXDa:Array<Float>, vecXDb:Array<Float>):Bool
return true if vectors paralleled
Parameters:
vecXDa |
|
---|---|
vecXDb |
|
staticvecXDscalar (vecXDa:Array<Float>, vecXDb:Array<Float>):Null<Float>
return scalar product of vectors
Parameters:
vecXDa |
|
---|---|
vecXDb |
|
staticvecXDcos (vecXDa:Array<Float>, vecXDb:Array<Float>):Null<Float>
return cos between vectors
Parameters:
vecXDa |
|
---|---|
vecXDb |
|
staticvecXDangle (vecXDa:Array<Float>, vecXDb:Array<Float>, rad:Bool = false):Null<Float>
return angle between vectors
Parameters:
vecXDa |
|
---|---|
vecXDb |
|
rad |
|
staticvec3Dnormal (vec3Da:Array<Float>, vec3Db:Array<Float>):Array<Float>
return vector 3D, which is result of cross product of vectors (normal vector of plane based on two vectors). Result vector placed so if you will see from end of result vector, then the rotating direction will be CCW from vec3Da to vec3Db
Parameters:
vec3Da |
|
---|---|
vec3Db |
|
staticvec3Dfieldnormal (vec3Dfield:Array<Array<Float>>):Array<Float>
return vector 3D, which is result of step by step cross product for each next vector 3D from vector field with previous cross product result vector 3D
Parameters:
vec3Dfield |
|
---|
staticvecXDmiddle (vecXDa:Array<Float>, vecXDb:Array<Float>):Array<Float>
return vector with middle value. Just call middle_xF([vecXDa, vecXDb])
Parameters:
vecXDa |
|
---|---|
vecXDb |
|
staticvecXDfieldmiddle (vecXDfield:Array<Array<Float>>):Array<Float>
return vector with middle value. Just call middle_xF(vecXDfield)
Parameters:
vecXDfield |
|
---|
staticvecXDsamesize (vecXDa:Array<Float>, vecXDb:Array<Float>):Null<Bool>
return true if vectors have same size. Bonus function. Just call same_size_F([vecXDa, vecXDb])
Parameters:
vecXDa |
|
---|---|
vecXDb |
|
staticvecXDfieldsamesize (vecXDfield:Array<Array<Float>>):Null<Bool>
return true if vector from vector field have same size. Bonus function. Just call same_size_F(vecXDfield)
Parameters:
vecXDfield |
|
---|
staticdotXDoffset (dotXD:Array<Float>, vecXD:Array<Float>, t:Float):Array<Float>
return dot, which result of offset dotXD along vecXD to t
Parameters:
dotXD |
|
---|---|
vecXD |
|
t |
|
staticdot3Dline3D_x_plane3D (dot3D0:Array<Float>, vec3D0:Array<Float>, vec3Dplane:Array<Float>, dplane:Float = 0):Array<Float>
return dot 3D, which is intersection dot for line3D(dot3D0, vec3D0) and plane3D(vec3Dplane, dplane)
Parameters:
dot3D0 |
|
---|---|
vec3D0 |
|
vec3Dplane |
|
dplane |
|
staticprojection_dot3D_on_plane3D (dot3D:Array<Float>, plane3D:Array<Float>):Array<Float>
return dot 3D, which is projection of dot3D to plane3D
Parameters:
dot3D |
|
---|---|
plane3D |
|
staticdot3D_to_dot2Dviewplane (dot3D:Array<Float>, dot3Dviewplanecenter:Array<Float>, vec3Dviewplane:Array<Float>, vec3Dviewplane_ox:Array<Float>):Array<Float>
return dot 2D (x, y) from dot3D projected on view plane, View plane determined by coordinate axes center plane 3D dot, and plane 3D normal vector. View plane vector 3D of axis ox, will be projected to view plane. Incoming value can not be strictly belongs to the view plane.
Parameters:
dot3D |
|
---|---|
dot3Dviewplanecenter |
|
vec3Dviewplane |
|
vec3Dviewplane_ox |
|
staticdotXDscale (dotXD:Array<Float>, scaleXD:Array<Float>, dotXDc:Array<Float>):Array<Float>
returns dot with scaled values relative to the scaling center
Parameters:
dotXD |
|
---|---|
scaleXD |
|
dotXDc |
|
staticvec3Drotate (vec3D:Array<Float>, vec3Daxis:Array<Float>, angle:Float, rad:Bool = false):Array<Float>
returns vector 3D, rotated around axis vector to angle
Parameters:
vec3D |
|
---|---|
vec3Daxis |
|
angle |
|
rad |
|
staticvec3Dfield_rotate_around_vec3Daxes (vec3Dfield:Array<Array<Float>>, vec3Daxes:Array<Array<Float>>, angles:Array<Float>, rad:Bool = false):Array<Array<Float>>
returns vector 3D field, each vector of which rotated to own angle, around own axis
Parameters:
vec3Dfield |
|
---|---|
vec3Daxes |
|
angles |
|
rad |
|
staticdot3Drotate (dot3D:Array<Float>, dot3Dc:Array<Float>, vec3D:Array<Float>, angle:Float, rad:Bool = false):Array<Float>
returns dot 3D, rotated to angle, around center of rotation determined by dot and axis of rotation
Parameters:
dot3D |
|
---|---|
dot3Dc |
|
vec3D |
|
angle |
|
rad |
|
staticplane3D_dot3Dnormal (dot3D:Array<Float>, vec3D:Array<Float>):Array<Float>
returns plane 3D (a, b, c, d) determined by dot 3D and vector 3D. Where (a, b, c) is plane 3D normal vector, and (d) is displacement plane from (0, 0, 0)
Parameters:
dot3D |
|
---|---|
vec3D |
|
staticplane3D_dot_vec_vec (dot3D:Array<Float>, vec3Da:Array<Float>, vec3Db:Array<Float>):Array<Float>
returns plane 3D (a, b, c, d), determined by dot and two not paralleled vectors. Where (a, b, c) is plane 3D normal vector, and (d) is displacement plane from (0, 0, 0)
Parameters:
dot3D |
|
---|---|
vec3Da |
|
vec3Db |
|
staticplane3D_3dots (dot3D:Array<Float>, dot3Da:Array<Float>, dot3Db:Array<Float>):Array<Float>
returns plane 3D (a, b, c, d), determined by three not equal dots. Where (a, b, c) is plane 3D normal vector, and (d) is displacement plane from (0, 0, 0)
Parameters:
dot3D |
|
---|---|
dot3Da |
|
dot3Db |
|
staticplane3D_2dots (dot3D:Array<Float>, dot3Da:Array<Float>):Array<Float>
returns plane 3D (a, b, c, d), determined by two not equal dots. Where (a, b, c) is plane 3D normal vector, and (d) is displacement plane from (0, 0, 0)
Parameters:
dot3D |
|
---|---|
dot3Da |
|
staticdistance_dot3D_plane3D (dot3D:Array<Float>, plane3D:Array<Float>):Null<Float>
returns distance from dot 3D to plane 3D
Parameters:
dot3D |
|
---|---|
plane3D |
|
staticrandom_vec3D_in_plane3D (plane3D:Array<Float>):Array<Float>
returns a random vector 3D paralleled to the plane 3D(lies on plane 3D)
Parameters:
plane3D |
|
---|
staticrandom_dot3D_in_plane3D (plane3D:Array<Float>, dot3D:Array<Float>, radius:Float):Array<Float>
returns random dot 3D belongs on plane 3D
Parameters:
plane3D |
|
---|---|
dot3D |
|
radius |
|
staticcurve3D_4dots (dot3D1:Array<Float>, vec3D1:Array<Float>, distance1:Float, dot3D2:Array<Float>, vec3D2:Array<Float>, distance2:Float):Array<Array<Float>>
returns curve 3D ((x, y, z), (x, y, z), (x, y, z), (x, y, z)) with internal dots, calculated use offset from border dots along levers to distances. The resul curve 3D have 4 dots 3D, two border dots incoming, and two internal dots calculated. Result will [dot3D1, dot3D1offset, dot3D2offset, dot3D2]
Parameters:
dot3D1 |
|
---|---|
vec3D1 |
|
distance1 |
|
dot3D2 |
|
vec3D2 |
|
distance2 |
|
staticcurve3D_3dots (dot3D0:Array<Float>, dot3D1:Array<Float>, dot3D2:Array<Float>, lever1:Float = 0.55, lever2:Float = 0.55, a_s:Int = -1):Array<Array<Float>>
returns curve 3D ((x, y, z), (x, y, z), (x, y, z), (x, y, z)). Shape of result curve will be close to arc (1/4 ellipse). Allowed few variants of result curve modification(distortion). Default lever1 and lever2 values equal 0.55. The 0.55 value in case of bezier cubic 3D curve will create shape close to ellipse arc.
Parameters:
dot3D0 |
|
---|---|
dot3D1 |
|
dot3D2 |
|
lever1 |
|
lever2 |
|
a_s |
|
staticline3D_2dots (dot3D0:Array<Float>, dot3D1:Array<Float>):Array<Array<Float>>
returns line 3D ((x, y, z), (x, y, z), (x, y, z), (x, y, z)). Which is (dot3D0, 1/3 offset, 2/3 offset, dot3D1). Comfort for use as bezier cubic curve 3D as straight line
Parameters:
dot3D0 |
|
---|---|
dot3D1 |
|
staticline3D_dot_offset (dot3D:Array<Float>, vec3D:Array<Float>, distance:Float):Array<Array<Float>>
returns line 3D ((x, y, z), (x, y, z), (x, y, z), (x, y, z)). Just call line3D_2dots with precalculated second dot 3D
Parameters:
dot3D |
|
---|---|
vec3D |
|
distance |
|
staticinlinecurve3D_4to12 (curve:Array<Array<Float>>):Array<Float>
returns curve 3D as 12 coordinates, recounted from 4 dots 3D. [[x, y, z], [x, y, z], [x, y, z], [x, y, z]] return [x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4]
Parameters:
curve |
|
---|
staticinlinecurve3D_12to4 (curve:Array<Float>):Array<Array<Float>>
returns curve 3D as 4 dots 3D, recounted from 12 coordinates. [x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4] return [[x, y, z], [x, y, z], [x, y, z], [x, y, z]]
Parameters:
curve |
|
---|
staticinlinebeziercubic3D_derivativeparameters (curve:Array<Array<Float>>):Array<Array<Float>>
beziercubic3D_derivative bonus function. returns parameters for derivative calculation. [[x1, y1, z1], [x2, y2, z2], [x3, y3, z3], [x4, y4, z4]] return [[x1,x2,x3,x4],[y1,y2,y3,y4],[z1,z2,z3,z4]]
Parameters:
curve |
|
---|
staticinlinebeziercubic_derivative (bcp:Array<Float>, p:Float):Null<Float>
return bezier cubic curve derivative for each dimension. Usual case x
or y
or z
Parameters:
bcp |
|
---|---|
p |
|
staticbeziercubic3D_derivative (curve:Array<Array<Float>>, p:Float):Array<Float>
returns bezier cubic curve 3D derivative
Parameters:
curve |
|
---|---|
p |
|
staticinlinebeziercubic_support_dot_one (beziercubic_one_axis_coordinates:Array<Float>):Null<Float>
returns cubic bezier curve support dot one(first lever) paramater for each coordinate. Usual case x
or y
or z
Parameters:
beziercubic_one_axis_coordinates |
|
---|
staticbeziercubic3D_support_dot_one (curve3D_4dots:Array<Array<Float>>):Array<Float>
returns dot 3D, which is bezier cubic curve 3D support dot one(first lever)
Parameters:
curve3D_4dots |
|
---|
staticinlinebeziercubic_support_dot_two (beziercubic_one_axis_coordinates:Array<Float>):Null<Float>
returns cubic bezier curve support dot two(second lever) paramater for each coordinate. Usual case x
or y
or z
Parameters:
beziercubic_one_axis_coordinates |
|
---|
staticbeziercubic3D_support_dot_two (curve3D_4dots:Array<Array<Float>>):Array<Float>
returns dot 3D, which is bezier cubic curve 3D support dot two(second lever)
Parameters:
curve3D_4dots |
|
---|
staticinlinebeziercubic3D_follow_4dots_trajectory (dots:Array<Array<Float>>):Array<Array<Float>>
returns bezier cubic curve 3D, calculated from 4dots 3D(curve 3D trajectory)
Parameters:
dots |
|
---|
staticinlinebeziercubic_coordinate (beziercubic_one_axis_coordinates:Array<Float>, parameter:Float):Null<Float>
returns bezier cubic coordinate for each one axis. Usual case x
or y
or z
Parameters:
beziercubic_one_axis_coordinates |
|
---|---|
parameter |
|
staticbeziercubic3Ddot (beziercubic3D:Array<Array<Float>>, parameter:Float):Array<Float>
returns dot 3D, belongs on bezier cubic curve 3D
Parameters:
beziercubic3D |
|
---|---|
parameter |
|
staticinlinecurve3D_4dots_follow_beziercubic_trajectory (beziercubic3D:Array<Array<Float>>):Array<Array<Float>>
returns curve 3D, which is 4 dots 3D bezier cubic curve, recounted to 4 dots 3D curve. Two internal dots belongs on bezier cubic curve trajectory, with parameter 1/3 and 2/3
Parameters:
beziercubic3D |
|
---|
staticinlinecurve3Doffset (curve3D:Array<Array<Float>>, vec3D:Array<Float>, distance:Float):Array<Array<Float>>
returns curve 3D, offsetted along vector 3D to specified distance
Parameters:
curve3D |
|
---|---|
vec3D |
|
distance |
|
staticinlinecurve3Drotate (curve3D:Array<Array<Float>>, dot3D:Array<Float>, vec3D:Array<Float>, angle:Float, rad:Bool = false):Array<Array<Float>>
returns curve 3D, rotated around axis(determined by dot 3D and vector 3D) to specified angle
Parameters:
curve3D |
|
---|---|
dot3D |
|
vec3D |
|
angle |
|
rad |
|
staticinlinecurve3Dscale (curve3D:Array<Array<Float>>, scale_xyz:Array<Float>, dot3D:Array<Float>):Array<Array<Float>>
returns curve 3D, scaled relative base dot 3D, uses own scale for each axis
Parameters:
curve3D |
|
---|---|
scale_xyz |
|
dot3D |
|
staticinlineellipse2Dperimeter_ramanujan (semiaxis_a:Float, semiaxis_b:Float):Null<Float>
returns ellipse perimeter, calculated use ramanujan method. Result will be max from perimeters, calculated by two ramanujan methods, with negative errors
Parameters:
semiaxis_a |
|
---|---|
semiaxis_b |
|
statictangent_centered_ellipse2Ddot (semiaxis_a:Float, semiaxis_b:Float, ellipse_dot2D:Array<Float>):Array<Array<Float>>
returns vector 2D, which is tangent of centered ellipse 2D
Parameters:
semiaxis_a |
|
---|---|
semiaxis_b |
|
ellipse_dot2D |
|
staticinlineellipse_e_parameter (semiaxis_a:Float, semiaxis_b:Float):Null<Float>
returns ellipse e parameter (ellipse eccentricity)
Parameters:
semiaxis_a |
|
---|---|
semiaxis_b |
|
staticellipse_c_parameter (semiaxis_a:Float, semiaxis_b:Float):Null<Float>
returns ellipse c parameter (elipse foci) ... фокальное расстояние (полурасстояние между фокусами)
Parameters:
semiaxis_a |
|
---|---|
semiaxis_b |
|
statictangent_vec3D_in_plane_of_ellipse2D_placed_in_3Dspace (dot3D:Array<Float>, vec3Dnormal_ellipse_plane:Array<Float>, vec3Dsemiaxis_a_direction:Array<Float>, semiaxis_a:Float, semiaxis_b:Float, semiaxis_a_negative:Float, semiaxis_b_negative:Float, angle:Float, rad:Bool):Array<Float>
returns vector 3D, which is tangent of ellipse, belongs to the plane 3D
Parameters:
dot3D |
|
---|---|
vec3Dnormal_ellipse_plane |
|
vec3Dsemiaxis_a_direction |
|
semiaxis_a |
|
semiaxis_b |
|
semiaxis_a_negative |
|
semiaxis_b_negative |
|
angle |
|
rad |
|
staticellipse3D_dots (dot3D:Array<Float>, vec3Dsemiaxes:Array<Array<Float>>, semiaxes:Array<Float>):Array<Array<Float>>
returns 9 dots 3D, ellipse center dot and 8 ellipse perimeter dots
Parameters:
dot3D |
|
---|---|
vec3Dsemiaxes |
|
semiaxes |
|
staticinlineellipse2Ddot (angle:Float, semiaxis_a_ox:Float, semiaxis_b_oy:Float, rad:Bool = false):Array<Float>
returns dot 2D, which belongs to ellipse perimeter
Parameters:
angle |
|
---|---|
semiaxis_a_ox |
|
semiaxis_b_oy |
|
rad |
|
staticcurve2D_4dots_elliptic_shape_restricted_to_quarter (angle0:Float, angle1:Float, semiaxis_a_ox:Float, semiaxis_b_oy:Float, rad:Bool = false):Array<Array<Float>>
returns curve 2D, which have ellipse shape restricted to quarter
Parameters:
angle0 |
|
---|---|
angle1 |
|
semiaxis_a_ox |
|
semiaxis_b_oy |
|
rad |
|
staticbeziercubic3D_elliptic_shape_restricted_to_quarter (dot3Dc:Array<Float>, vec3D_a_ox:Array<Float>, vec3D_b_oy:Array<Float>, semiaxis_a_ox:Float, semiaxis_b_oy:Float, angle0:Float, angle1:Float, rad:Bool = false):Array<Array<Float>>
returns bezier curve 3D, which have ellipse shape restricted to quarter. Result will have form [[x1, y1, z1], [x2, y2, z2], [x3, y3, z3], [x4, y4, z4]]
Parameters:
dot3Dc |
|
---|---|
vec3D_a_ox |
|
vec3D_b_ox |
|
semiaxis_a_ox |
|
semiaxis_b_oy |
|
angle0 |
|
angle1 |
|
rad |
|
staticangle_required_to_place_curve_on_ellipse (curve_length:Float, semiaxis_a_ox:Float, semiaxis_b_oy:Float, angle0:Float, rad:Bool = false):Null<Float>
returns angle required to place curve on ellipse. Max returned value is 360 degrees, or radians same value angle
Parameters:
curve_length |
|
---|---|
semiaxis_a_ox |
|
semiaxis_b_oy |
|
angle0 |
|
rad |
|
staticpolygon3D_inside_ellipse (dot3D:Array<Float>, vec3Dsemiaxes:Array<Array<Float>>, semiaxes:Array<Float>, angle_proportions:Array<Float>):Array<Array<Float>>
returns polygon 3D dots array, which is poligon center dot and array of polygon perimeter dots. Result will have form [`dot3D`, dot3D(1), ... ,dot3D(`angle_proportion.length`)]
Parameters:
dot3D |
|
---|---|
vec3Dsemiaxes |
|
semiaxes |
|
angle_proportions |
|
staticpolygon3D_vec3Dfield_distances (dot3D:Array<Float>, vec3Dfield:Array<Array<Float>>, distances:Array<Float>):Array<Array<Float>>
polygon on vectors and displacements. Can be not belongs to one plane 3D. returns polygon 3D dots array, which is poligon center dot and array of polygon perimeter dots. Result will have form [`dot3D`, dot3D(1), ... ,dot3D(`distances.length`)]
Parameters:
dot3D |
|
---|---|
vec3Dfield |
|
distances |
|
staticpolygon3D_in_plane (dot3D:Array<Float>, vec3Dplane_normal:Array<Float>, vec3Dsemiaxis_a_direction:Array<Float>, angle_proportions:Array<Float>, distances:Array<Float>):Array<Array<Float>>
polygon belongs to plane 3D. returns polygon 3D dots array, which is poligon center dot and array of polygon perimeter dots. Result will have form [`dot3D`, dot3D(1), ... ,dot3D(`angle_proportion.length`)].
Parameters:
dot3D |
|
---|---|
vec3Dplane_normal |
|
vec3Dsemiaxis_a_direction |
|
angle_proportions |
|
distances |
|
staticpolygon3D_to_vec3Dfield (polygon3D:Array<Array<Float>>):Array<Array<Float>>
returns vector field, which is vectors 3D, calculated from polygon center dot to each vertex. Result will have form [[a, b, c], ... , [a, b, c]], depend of incoming data length
Parameters:
polygon3D |
|
---|
staticprojection_vec3D_on_plane3D (vec3D:Array<Float>, plane3D:Array<Float>):Array<Float>
returns vector 3D, which is vec3D
vector projection on plane3D
plane
Parameters:
vec3D |
|
---|---|
plane3D |
|
staticangle_vec3Dvec3D_projection_on_plane3D (vec3D1:Array<Float>, vec3D2:Array<Float>, plane3D:Array<Float>, rad:Bool = false):Null<Float>
returns angle, which is projection of angle between vec3D1
and vec3D2
vectors to plane3D
Parameters:
vec3D1 |
|
---|---|
vec3D2 |
|
plane3D |
|
rad |
|