Class | PVector | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Name | dot() |
||||||||||
Examples | PVector v = new PVector(10, 20, 0); float d = v.dot(60, 80, 0); println(d); // Prints "2200.0" PVector v1, v2; void setup() { size(100, 100); v1 = new PVector(20.0, 30.0, 40.0); v2 = new PVector(0.0, 0.0, 0.0); v2.set(v1); println(v2.x); // Prints "20.0" println(v2.y); // Prints "30.0" println(v2.z); // Prints "40.0" } PVector v1 = new PVector(10, 20, 0); PVector v2 = new PVector(60, 80, 0); float d = v1.dot(v2); println(d); // Prints "2200.0" |
||||||||||
Description | Calculates the dot product of two vectors. |
||||||||||
Syntax | vec.dot(x,y,z) vec.dot(v) |
||||||||||
Parameters |
|
||||||||||
Returns | float | ||||||||||
Usage | Web & Application |