Пример #1
0
 internal static Point3d RandomPoint(Point3d min, Point3d max)
 {
   double x = Random.RandomDouble(min.X, max.X);
   double y = Random.RandomDouble(min.Y, max.Y);
   double z = Random.RandomDouble(min.Z, max.Z);
   return new Point3d(x, y, z);
 }
Пример #2
0
 public Bounds(Point3d min, Point3d max)
 {
   Vector3 lb = new Vector3((float)min.X, (float)min.Y, (float)min.Z);
   Vector3 rt = new Vector3((float)max.X, (float)max.Y, (float)max.Z);
   this.center = new Vector3((lb.X + rt.X) / 2, (lb.Y + rt.Y) / 2, (lb.Z + rt.Z) / 2);
   this.r = new Vector3(rt.X - center.X, rt.Y - center.Y, rt.Z - center.Z);
   this.lb = lb;
   this.rt = rt;
 }
Пример #3
0
 public static double DistanceSquared(Point3d p1, Point3d p2)
 {
   return (Math.Pow(p1.X - p2.X, 2) +
                            Math.Pow(p1.Y - p2.Y, 2) +
                            Math.Pow(p1.Z - p2.Z, 2));
 }
Пример #4
0
 public AgentType(AgentType agent)
 {
   this.position = agent.position;
   this.refPosition = agent.refPosition;
 }
Пример #5
0
    public AgentType(AgentType agent, Point3d position, Point3d refPosition)
    {

      this.position = position;
      this.refPosition = refPosition;
    }
Пример #6
0
 public AgentType(Point3d position)
 {
   this.position = position;
   this.refPosition = position;
 }
Пример #7
0
 public AgentType()
 {
   this.position = Point3d.Origin;
   this.refPosition = Point3d.Origin;
 }
Пример #8
0
 public double DistanceSquared(Point3d pt)
 {
   return (Math.Pow(this.X - pt.X, 2) +
           Math.Pow(this.Y - pt.Y, 2) +
           Math.Pow(this.Z - pt.Z, 2));
 }
Пример #9
0
 public double DistanceTo(Point3d pt)
 {
   return Math.Sqrt(Math.Pow(this.x + pt.x, 2) + Math.Pow(this.y + pt.y, 2) + Math.Pow(this.z + pt.z, 2));
 }
Пример #10
0
 public Point3d(Point3d pt)
 {
   this.x = pt.x;
   this.y = pt.y;
   this.z = pt.z;
 }