Vector3 this one I’m using without problems post your code to keep a class together on MapWingis it will help everyone ok let’s get together to exchange experiences and help each other.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WindowsFormsApp2
{
public class Vector3
{
private double x;
private double y;
private double z;
private float v;
public Vector3(double x, double y)
{
this.X = x;
this.Y = y;
this.Z = 0.0;
}
public Vector3(double x, double y, double z)
: this(x, y)
{
this.Z = z;
}
public Vector3(float v)
{
this.v = v;
}
public double X
{
get { return this.x; }
set { this.x = value; }
}
public double Y
{
get { return this.y; }
set { this.y = value; }
}
public double Z
{
get { return this.z; }
set { this.z = value; }
}
public System.Drawing.PointF ToPointF
{
get
{
return new System.Drawing.PointF((float)X, (float)Y);
}
}
public static Vector3 Zero
{
get { return new Vector3(0.0, 0.0, 0.0); }
}
public double DistanciaFrom(Vector3 v)
{
double dx = v.X - X;
double dy = v.Y - Y;
double dz = v.Z - Z;
return Math.Sqrt(dx * dx + dy * dy + dz * dz);
}
public Vector2 ToVector2
{
get { return new Vector2((double)X, (double)Y); }
//{return new Vector2(X,Y);}
}
public override string ToString()
{
return String.Format("{0},{1},{2}", X, Y, Z);
}
internal double DistanceFrom(object startPoint)
{
throw new NotImplementedException();
}
}
}