Ejemplo n.º 1
0
        public double calculateAngle(Point3D p)
        {
            double scalarProduct = this.dotProduct(p);
            double magnitudeA = this.magnitude();
            double magnitudeB = p.magnitude();

            double theta = Math.Acos(scalarProduct / (magnitudeA * magnitudeB)) * (180.0 / Math.PI);
            return theta;
        }
Ejemplo n.º 2
0
        public VolumeDetector()
        {
            this._rightHandHistory = new ScenarioStateHistory(30,0);
            this._leftHandHistory = new ScenarioStateHistory(30,0);

            rh_adjustInitiated = false;
            lh_adjustInitiated = false;

            rh_start = new Point3D(-1, -1, -1);
            lh_start = new Point3D(-1, -1, -1);

            rh_last = new Point3D(-1, -1, -1);
            lh_last = new Point3D(-1, -1, -1);

            rh_deltaY = 0;
            lh_deltaY = 0;
        }
Ejemplo n.º 3
0
 protected Boolean stillWithinXBounds(double hand_x, Point3D start)
 {
     //Console.WriteLine("Z Diff: " + Math.Abs(hand_z - start.Z));
     return (Math.Abs(hand_x - start.X) < MAX_X_ALLOWANCE);
     //return true;
 }
Ejemplo n.º 4
0
 public Point3D subtract(Point3D p)
 {
     return new Point3D(this.X - p.X, this.Y - p.Y, this.Z - p.Z);
 }
Ejemplo n.º 5
0
 public double dotProduct(Point3D p)
 {
     return (this.X*p.X + this.Y*p.Y + this.Z*p.Z);
 }
Ejemplo n.º 6
0
 public Point3D add(Point3D p)
 {
     return new Point3D(this.X + p.X, this.Y + p.Y, this.Z + p.Z);
 }