Exemple #1
0
        // This just builds the raw offsets for a particular resolution in degrees
        public static List<Polar> buildRawOffsets(double resolution, double wheelDiameter)
        {
            List<Polar> offsets = new List<Polar>();

            CompGeometry cg = new CompGeometry();
            for (double alpha = 0; alpha < Constants.R360; alpha += Change.toRadians(resolution))
            {
                double a = Change.toDegrees(alpha);
                double offset = cg.compGrinderOffset(alpha);
                offsets.Add(new Polar(offset, alpha));
            }

            return offsets;
        }
Exemple #2
0
        public void drawGrinder(double alpha)
        {
            double offset;
            float wheelCentreX;
            float wheelCentreY;

            CompGeometry cg = new CompGeometry();
            offset = cg.compGrinderOffset(Change.toRadians(alpha));
            wheelCentreX = (float)(offset * Math.Sin(Change.toRadians(alpha)));
            wheelCentreY = (float)(offset * Math.Cos(Change.toRadians(alpha)));

            //wheelCentreX = 0;
            //wheelCentreY = (float)offset;

            g.drawLine(grinderPen, 0, 0, wheelCentreX, wheelCentreY);
            g.drawArc(grinderPen, wheelCentreX, wheelCentreY, Data.dWheelDiameter / 2, 0, 360);

            //g.drawLine(grinderPen, 0, (float)(B + L - N), wheelCentreX, wheelCentreY)
        }
Exemple #3
0
        private void computeGrinder()
        {
            double prevOffset = 0;
            CompGeometry cg = new CompGeometry();

            for (double alpha = Constants.R90; alpha >= 0; alpha -= Change.toRadians(STEPSIZE) )
            {
                Polar offset = new Polar(cg.compGrinderOffset(alpha) - Data.dBaseRadius - Data.dWheelDiameter/2, alpha);

                if (prevOffset != 0 && Math.Abs((offset.r - prevOffset)) > 0.001)
                {
                    double x = Change.toDegrees(alpha);
                }
                prevOffset = offset.r;

                pGrinder.Add(offset);
                double lift = offset.r;
                pLift.Add(new Polar(lift, alpha));
                if (lift > maxGrind.r) { maxGrind = new Polar(lift, alpha); }
                if (lift < minGrind.r) { minGrind = new Polar(lift, alpha); }
            }
        }