示例#1
0
        public void CosFTest()
        {
            float angle    = 100;
            float expected = MathF.Cos(angle);
            float result   = SharedUtilities.CosF(angle);

            Assert.AreEqual(expected, result);
        }
示例#2
0
        public static void FillNgonAtCenter(this Graphics g, Brush b, int n, float x, float y, float diameter = 10, float phase = 0)
        {
            float radius = diameter / 2f;

            PointF[] points     = new PointF[n];
            float    angle      = SharedUtilities.DegToRad(phase);
            float    deltaAngle = SharedUtilities.PI * 2f / n;

            for (int i = 0; i < n; i++)
            {
                points[i] = new PointF(
                    x + radius * SharedUtilities.CosF(angle),
                    y + radius * SharedUtilities.SinF(angle));
                angle += deltaAngle;
            }
            g.FillPolygon(b, points);
        }
示例#3
0
 public void CosFTest()
 {
     Assert.IsTrue(SharedUtilities.CosF(0).Equals((float)Math.Cos(0)));
 }