/// <summary> /// Initializes this instance's <see cref="Scale" /> property with a /// traditional type of grading scale. /// </summary> public override void Initialize() { Scale.Add('A', new Tuple <int, int>(90, 100)); Scale.Add('B', new Tuple <int, int>(80, 89)); Scale.Add('C', new Tuple <int, int>(70, 79)); Scale.Add('D', new Tuple <int, int>(60, 69)); Scale.Add('F', new Tuple <int, int>(0, 59)); }
public void Start() { float percent = 0, cpercent = 0.0f; double scalex, scaley; int c, crot = 0; //Shape temp; Matrix points; Matrix ctrans, m, m2, r; SPoint center; foreach (Shape s in b) { points = a.ShapePoints; ctrans = Matrix.Indentity(3); //temp = a; scalex = a.ShapeBitmap.Width < s.ShapeBitmap.Width ? Math.Round(s.Center.X / a.Center.X) : 1 / Math.Round(a.Center.X / s.Center.X); scaley = a.ShapeBitmap.Height < s.ShapeBitmap.Height ? Math.Round(s.Center.X / a.Center.X) : 1 / Math.Round(a.Center.X / s.Center.X); ctrans *= Matrix.Scale(scalex, scaley); center = a.Center; center.X *= (float)scalex; center.Y *= (float)scaley; points *= ctrans; /*crot = 0;-----------------BROKEN ROTATION STUFF * for (int i = 0; i < 8; i++) * { * //points = a.ShapePoints; * * m = Matrix.Translation(-center.X, -center.Y); * r = Matrix.Rotation(Math.PI/4); * m2 = Matrix.Translation(center.X, center.Y); * ctrans *= (m * r * m2); * * temp.ShapePoints *= ctrans; * * temp.ResetPoints(); * * //points *= ctrans; * * c = Hit(s, temp.ShapePoints); * percent = ((float)c / (float)temp.ShapePoints.Count()) * 100.0f; * * if (percent > cpercent) * { * cpercent = percent; * crot = i; * if (percent == 100.0f) * { * break; * } * * } * } * crot *= 45;*/ c = Hit(s, points); percent = ((float)c / (float)a.ShapePoints.Count()) * 100.0f; Percent.Add(percent); Results.Add(s.Name); Scale.Add(scalex.ToString("0.0") + "," + scaley.ToString("0.0")); //Rotation.Add(crot.ToString()); } }