Esempio n. 1
0
        /// <summary> Translates the hyperbolic tree by the given vector.
        /// </summary>
        /// <param name="zs">The first coordinates.</param>
        /// <param name="ze">The second coordinates.</param>
        public void Translate(EuclidianVector zs, EuclidianVector ze)
        {
            EuclidianVector __zo = new EuclidianVector(_rootNodeView.OldCoordinates);

            __zo.X = -__zo.X;
            __zo.Y = -__zo.Y;
            EuclidianVector __zs2 = new EuclidianVector(zs);

            __zs2.Translate(__zo);

            EuclidianVector __t  = new EuclidianVector();
            double          __de = ze.D2();
            double          __ds = __zs2.D2();
            double          __dd = 1.0 - __de * __ds;

            __t.X = (ze.X * (1.0 - __ds) - __zs2.X * (1.0 - __de)) / __dd;
            __t.Y = (ze.Y * (1.0 - __ds) - __zs2.Y * (1.0 - __de)) / __dd;

            if (__t.IsValid)
            {
                HyperbolicTransformation __to = new HyperbolicTransformation();
                __to.Composition(__zo, __t);

                _rootNodeView.Transform(__to);
                _view.Repaint();
            }
        }
Esempio n. 2
0
        /// <summary> Transform this node by the given transformation.
        /// </summary>
        /// <param name="t">The transformation.</param>
        public override void Transform(HyperbolicTransformation t)
        {
            base.Transform(t);

            foreach (NodeView child in _childNodes)
            {
                child.Transform(t);
                Geodesic __geodesic = _geodesics[child];
                if (__geodesic != null)
                {
                    __geodesic.Rebuild();
                }
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Transform this node by the given transformation.
        /// </summary>
        /// <param name="t">The transformation.</param>
        public void Transform(HyperbolicTransformation t)
        {
            EuclidianVector __z = new EuclidianVector(this);

            Multiply(t.O);
            _x += t.P._x;
            _y += t.P._y;

            EuclidianVector __d = new EuclidianVector(t.P);

            __d._y = -__d._y;
            __d.Multiply(__z);
            __d.Multiply(t.O);
            __d._x += 1;

            this.Divide(__d);
        }
Esempio n. 4
0
 /// <summary> Transform this node by the given transformation.
 /// </summary>
 /// <param name="t">The transformation.</param>
 public virtual void Transform(HyperbolicTransformation t)
 {
     _ze.Copy(_oldZe);
     _ze.Transform(t);
 }
Esempio n. 5
0
 /// <summary> Transform this node by the given transformation.
 /// </summary>
 /// <param name="t">The transformation.</param>
 public virtual void Transform(HyperbolicTransformation t)
 {
     _ze.Copy(_oldZe);
     _ze.Transform(t);
 }
Esempio n. 6
0
        /// <summary> Translates the hyperbolic tree by the given vector.
        /// </summary>
        /// <param name="zs">The first coordinates.</param>
        /// <param name="ze">The second coordinates.</param>
        public void Translate(EuclidianVector zs, EuclidianVector ze)
        {
            EuclidianVector __zo = new EuclidianVector(_rootNodeView.OldCoordinates);
            __zo.X = -__zo.X;
            __zo.Y = -__zo.Y;
            EuclidianVector __zs2 = new EuclidianVector(zs);
            __zs2.Translate(__zo);

            EuclidianVector __t = new EuclidianVector();
            double __de = ze.D2();
            double __ds = __zs2.D2();
            double __dd = 1.0 - __de * __ds;
            __t.X = (ze.X * (1.0 - __ds) - __zs2.X * (1.0 - __de)) / __dd;
            __t.Y = (ze.Y * (1.0 - __ds) - __zs2.Y * (1.0 - __de)) / __dd;

            if (__t.IsValid)
            {
                HyperbolicTransformation __to = new HyperbolicTransformation();
                __to.Composition(__zo, __t);

                _rootNodeView.Transform(__to);
                _view.Repaint();
            }
        }
        /// <summary>
        /// Transform this node by the given transformation.
        /// </summary>
        /// <param name="t">The transformation.</param>
        public void Transform(HyperbolicTransformation t)
        {
            EuclidianVector __z = new EuclidianVector(this);
              Multiply(t.O);
              _x += t.P._x;
              _y += t.P._y;

              EuclidianVector __d = new EuclidianVector(t.P);
              __d._y = -__d._y;
              __d.Multiply(__z);
              __d.Multiply(t.O);
              __d._x += 1;

              this.Divide(__d);
        }