MCPcopy Index your code
hub / github.com/apache/groovy / scale

Method scale

benchmark/bench/raytracer.java:15–15  ·  view source on GitHub ↗
(double s, Vec a)

Source from the content-addressed store, hash-verified

13 Vec add(Vec a, Vec b) { return new Vec(a.x+b.x, a.y+b.y, a.z+b.z); }
14 Vec sub(Vec a, Vec b) { return new Vec(a.x-b.x, a.y-b.y, a.z-b.z); }
15 Vec scale(double s, Vec a) { return new Vec(s*a.x, s*a.y, s*a.z); }
16 double dot(Vec a, Vec b) { return a.x*b.x + a.y*b.y + a.z*b.z; }
17 Vec unitise(Vec a) { return scale(1 / Math.sqrt(dot(a, a)), a); }
18 class Ray {

Callers 4

unitiseMethod · 0.95
ray_traceMethod · 0.95
intersectMethod · 0.80
divideImplMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected