rustgd / cgmath

A linear algebra and mathematics library for computer graphics.
https://docs.rs/cgmath
Apache License 2.0
1.12k stars 155 forks source link

[question] cannot subtract `Vector3<T>` from `Vector3<T> #550

Closed sonygod closed 1 year ago

sonygod commented 1 year ago
      pub trait Three_Vector<T: Num + Copy + ComplexFloat + FloatCore> {

          fn lerp_vectors(&self, v1: Vector3<T>, v2: Vector3<T>, alpha: T) -> Vector3<T>;

      }

      pub trait Three_Vector<T: Num + Copy + ComplexFloat + FloatCore> {
      fn lerp_vectors(&self, v1: Vector3<T>, v2: Vector3<T>, alpha: T) -> Vector3<T> {
          v1 + (v2 - v1) * alpha   //here say cannot subtract `Vector3<T>` from `Vector3<T>
      }
      }

hello, I want to ask how to fixed cannot subtract Vector3<T> from `Vector3?

sonygod commented 1 year ago

sorry,use BaseNum instead of Num. done