mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 06:10:56 +00:00
21 lines
293 B
R
21 lines
293 B
R
|
#include "test-harness.h"
|
|||
|
|
|||
|
vector a = { 1, 0, 0 };
|
|||
|
vector b = { 0, 1, 0 };
|
|||
|
vector c = { 0, 0, 1 };
|
|||
|
|
|||
|
int
|
|||
|
main ()
|
|||
|
{
|
|||
|
vector v = a × b;
|
|||
|
if (v != c) {
|
|||
|
printf ("cross product failed\n");
|
|||
|
return 1;
|
|||
|
};
|
|||
|
if (v · c != [1, 1, 1]) {
|
|||
|
printf ("dot product failed\n");
|
|||
|
return 1;
|
|||
|
}
|
|||
|
return 0;
|
|||
|
}
|