Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
23
Task/Vector-products/GLSL/vector-products.glsl
Normal file
23
Task/Vector-products/GLSL/vector-products.glsl
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
vec3 a = vec3(3, 4, 5),b = vec3(4, 3, 5),c = vec3(-5, -12, -13);
|
||||
|
||||
float dotProduct(vec3 a, vec3 b)
|
||||
{
|
||||
return a.x*b.x+a.y*b.y+a.z*b.z;
|
||||
}
|
||||
|
||||
vec3 crossProduct(vec3 a,vec3 b)
|
||||
{
|
||||
vec3 c = vec3(a.y*b.z - a.z*b.y, a.z*b.x - a.x*b.z, a.x*b.y- a.y*b.x);
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
float scalarTripleProduct(vec3 a,vec3 b,vec3 c)
|
||||
{
|
||||
return dotProduct(a,crossProduct(b,c));
|
||||
}
|
||||
|
||||
vec3 vectorTripleProduct(vec3 a,vec3 b,vec3 c)
|
||||
{
|
||||
return crossProduct(a,crossProduct(b,c));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue