public TestingCompoundVertexInfo(Vector springForce, Vector repulsionForce, Vector gravityForce, Vector applicationForce)
 {
     SpringForce = springForce;
     RepulsionForce = repulsionForce;
     GravityForce = gravityForce;
     ApplicationForce = applicationForce;
 }
Beispiel #2
0
 public static double AngleBetween(Vector vector1, Vector vector2)
 {
     var y = (vector1._x * vector2._y) - (vector2._x * vector1._y);
     var x = (vector1._x * vector2._x) + (vector1._y * vector2._y);
     return (Math.Atan2(y, x) * 57.295779513082323);
 }
Beispiel #3
0
 public static double CrossProduct(Vector vector1, Vector vector2)
 {
     return ((vector1._x * vector2._y) - (vector1._y * vector2._x));
 }
Beispiel #4
0
 public bool Equals(Vector value)
 {
     return Equals(this, value);
 }
Beispiel #5
0
 public static bool Equals(Vector vector1, Vector vector2)
 {
     return (vector1.X.Equals(vector2.X) && vector1.Y.Equals(vector2.Y));
 }
Beispiel #6
0
 public static Rect Offset(Rect rect, Vector offsetVector)
 {
     rect.Offset(offsetVector.X, offsetVector.Y);
     return rect;
 }
Beispiel #7
0
 public void Offset(Vector offsetVector)
 {
     if (IsEmpty)
     {
         throw new InvalidOperationException("Rect_CannotCallMethod");
     }
     _x += offsetVector._x;
     _y += offsetVector._y;
 }
Beispiel #8
0
 public Rect(Point point, Vector vector)
     : this(point, point + vector)
 {
 }
Beispiel #9
0
 public static bool IsSameDirection(Vector a, Vector b)
 {
     return Math.Sign(a.X) == Math.Sign(b.X) && Math.Sign(a.Y) == Math.Sign(b.Y);
 }
Beispiel #10
0
        private void OnMouseDown(PointerRoutedEventArgs e, bool isPreview)
        {
            if (ModifierMode != ZoomViewModifierMode.None)
                return;
            _startedAsAreaSelection = false;
            switch (e.KeyModifiers)
            {
                case VirtualKeyModifiers.None:
                    if (!isPreview)
                        ModifierMode = ZoomViewModifierMode.Pan;
                    break;
                case VirtualKeyModifiers.Windows | VirtualKeyModifiers.Control:
                    _startedAsAreaSelection = true;
                    ModifierMode = ZoomViewModifierMode.ZoomBox;
                    break;
                case VirtualKeyModifiers.Windows:
                    ModifierMode = ZoomViewModifierMode.ZoomBox;
                    break;
                case VirtualKeyModifiers.Control:
                    break;
                case VirtualKeyModifiers.Shift:
                    ModifierMode = ZoomViewModifierMode.Pan;
                    break;
                default:
                    return;
            }

            if (ModifierMode == ZoomViewModifierMode.None)
                return;

            _mouseDownPos = e.GetCurrentPoint(this).Position;
            _startTranslate = new Vector(TranslateX, TranslateY);
            CapturePointer(e.Pointer);
            PointerMoved += ZoomControl_PreviewMouseMove;
        }