Ejemplo n.º 1
0
 private void pictureBox1_MouseMove(object sender, MouseEventArgs e)
 {
     if (moving && moveID >= 0)
     {
         sequenz.Shape.Positions[moveID].X = Mathhelper.RoundOff(e.X);
         sequenz.Shape.Positions[moveID].Y = Mathhelper.RoundOff(e.Y);
         update();
     }
 }
Ejemplo n.º 2
0
        public void dist()
        {
            KCPoint p1 = new KCPoint();

            p1.X = 0;
            p1.Y = 0;
            KCPoint p2 = new KCPoint();

            p2.X = 10;
            p2.Y = 10;

            double dist = Math.Sqrt(100 + 100);

            Assert.AreEqual(dist, Mathhelper.dist(p1, p2));
        }
Ejemplo n.º 3
0
        public int select(KCPoint point)
        {
            //Console.WriteLine("------------");
            for (int i = 0; i < positions.Count; i++)
            {
                if (Mathhelper.dist(positions[i], point) < diameter)
                {
                    return(i);
                }
            }



            return(-1);
        }
Ejemplo n.º 4
0
 public void RoundOff()
 {
     Assert.AreEqual(120, Mathhelper.RoundOff(124));
     Assert.AreEqual(120, Mathhelper.RoundOff(115));
 }