| 1 |
// testing Math.euclidean, which has three overloaded variants |
| 2 |
// added 1.5.0.0 |
| 3 |
|
| 4 |
@(0,0,0) => vec3 a; |
| 5 |
@(1,1,1) => vec3 b; |
| 6 |
|
| 7 |
@(0,0,0,0) => vec4 aa; |
| 8 |
@(1,1,1,1) => vec4 bb; |
| 9 |
|
| 10 |
[0.0, 0, 0, 0, 0] @=> float aaa[]; |
| 11 |
[1.0, 1, 1, 1, 1] @=> float bbb[]; |
| 12 |
|
| 13 |
Math.euclidean( a, b ) => float y; |
| 14 |
Math.euclidean( aa, bb ) => float yy; |
| 15 |
Math.euclidean( aaa, bbb ) => float yyy; |
| 16 |
|
| 17 |
// the answer |
| 18 |
Math.sqrt(3) => float answer1; |
| 19 |
Math.sqrt(4) => float answer2; |
| 20 |
Math.sqrt(5) => float answer3; |
| 21 |
|
| 22 |
// use Math.equal() to test for equality |
| 23 |
if( Math.equal( y, answer1 ) && |
| 24 |
Math.equal( yy, answer2 ) && |
| 25 |
Math.equal( yyy, answer3 ) ) |
| 26 |
{ |
| 27 |
<<< "success" >>>; |
| 28 |
} |
| 29 |
|