示例#1
0
 public static scalar length(this vec2 v) => v.Length;
示例#2
0
        public static vec2 normalize(vec2 v)
        {
            float sqr = v.x * v.x + v.y * v.y;

            return(v * (1.0f / (float)Math.Sqrt(sqr)));
        }
示例#3
0
文件: vec2.cs 项目: wzx1996/glmnet
 public vec2(vec2 v)
 {
     this.x = v.x;
     this.y = v.y;
 }
示例#4
0
        public static float dot(vec2 x, vec2 y)
        {
            vec2 tmp = new vec2(x * y);

            return(tmp.x + tmp.y);
        }
示例#5
0
文件: vec3.cs 项目: wzx1996/glmnet
 public vec3(vec2 xy, float z)
 {
     this.x = xy.x;
     this.y = xy.y;
     this.z = z;
 }