Currently the «Angle Between» node returns a value between 0 and π radians. This should be adjusted to be between -π and +π radians, going in an anticlockwise direction. This can be achieved with DVec2::angle_to function in glam.
|
fn angle_between(_: impl Ctx, vector_a: DVec2, vector_b: DVec2, radians: bool) -> f64 { |
|
let dot_product = vector_a.normalize_or_zero().dot(vector_b.normalize_or_zero()); |
|
let angle = dot_product.acos(); |
|
if radians { angle } else { angle.to_degrees() } |
Suggested by Paulchen in discord.
Currently the «Angle Between» node returns a value between 0 and π radians. This should be adjusted to be between -π and +π radians, going in an anticlockwise direction. This can be achieved with
DVec2::angle_tofunction in glam.Graphite/node-graph/nodes/math/src/lib.rs
Lines 828 to 831 in 5543afd
Suggested by Paulchen in discord.