The dot product operation (·) calculates the degree of similarity of a vec2 pair based on their angles and lengths.
Calculated as ‖a‖‖b‖cos(θ), it represents the product of their lengths (‖a‖‖b‖) scaled by the alignment of their directions (cos(θ)). The output ranges from the positive to negative product of their lengths based on when they are pointing in the same or opposite directions. If any vector has zero length, the output is 0.
Interface
Inputs
| Parameter | Details | Possible Types |
|---|---|---|
| Vector A | An operand of the dot product operation. Primary Input | vec2 |
| Vector B | The other operand of the dot product operation. Default: | vec2 |
| Normalize | Whether to normalize both input vectors so the calculation ranges in Default: | bool |
Outputs
| Product | Details | Possible Types |
|---|---|---|
| Result | The value produced by the node operation. Primary Output | f64 |