Beispiel #1
0
        public Position2 GetInverted()
        {
            Position2 result = new Position2(this);

            result.Invert();
            return(result);
        }
Beispiel #2
0
        public Position2 DifferenceWith(Position2 position)
        {
            Position2 result = new Position2();

            result.SetDifferenceOf(this, position);
            return(result);
        }
Beispiel #3
0
 public void SetDifferenceOf(Position2 position, Position2 subtrahend)
 {
     this.Point = subtrahend.Angle.TurnBackward(position.Point - subtrahend.Point);
     this.Angle = position.Angle - subtrahend.Angle;
 }
Beispiel #4
0
 public Position2 CombineWith(Position2 position)
 {
     return(new Position2(this, position));
 }
Beispiel #5
0
 public void SetCombinationOf(Position2 first, Position2 second)
 {
     this.Point = first.Point + first.Angle.Turn(second.Point);
     this.Angle = first.Angle + second.Angle;
 }
Beispiel #6
0
 public void SetPosition(Position2 position)
 {
     this.Point = position.Point;
     this.Angle = position.Angle;
 }
Beispiel #7
0
 public Position2(Position2 first, Position2 second)
 {
     this.Point = first.Point + first.Angle.Turn(second.Point);
     this.Angle = first.Angle + second.Angle;
 }
Beispiel #8
0
 public Position2(Position2 position)
 {
     this.Point = position.Point;
     this.Angle = position.Angle;
 }
Beispiel #9
0
 public Vector2 ChangePositioningFrom(Position2 position, Vector2 vector)
 {
     return(this.Angle.TurnBackward(position.Angle.Turn(vector) + position.Point - this.Point));
 }
Beispiel #10
0
 public Vector2 ChangePositioningTo(Position2 position, Vector2 vector)
 {
     return(position.Angle.TurnBackward(this.Angle.Turn(vector) + this.Point - position.Point));
 }