Permalink
Browse files

Identation fixes

  • Loading branch information...
1 parent de0483e commit 450e61b764e1fbc1c685ac295b696161d44e3783 @Poincare committed Apr 7, 2012
Showing with 33 additions and 32 deletions.
  1. +33 −32 WUW01/classes/Utils.cs
View
@@ -15,33 +15,34 @@ public class Utils
#region Lengths and Rects
public static RectangleR FindBox(ArrayList points)
- {
- double minX = double.MaxValue;
- double maxX = double.MinValue;
- double minY = double.MaxValue;
- double maxY = double.MinValue;
+ {
+ double minX = double.MaxValue;
+ double maxX = double.MinValue;
+ double minY = double.MaxValue;
+ double maxY = double.MinValue;
- foreach (PointR p in points)
- {
- if (p.X < minX)
- minX = p.X;
- if (p.X > maxX)
- maxX = p.X;
-
- if (p.Y < minY)
- minY = p.Y;
- if (p.Y > maxY)
- maxY = p.Y;
- }
+ foreach (PointR p in points)
+ {
+ if (p.X < minX)
+ minX = p.X;
+ if (p.X > maxX)
+ maxX = p.X;
+
+ if (p.Y < minY)
+ minY = p.Y;
- return new RectangleR(minX, minY, maxX - minX, maxY - minY);
+ if (p.Y > maxY)
+ maxY = p.Y;
}
-
- public static double Distance(PointR p1, PointR p2)
- {
- double dx = p2.X - p1.X;
- double dy = p2.Y - p1.Y;
- return Math.Sqrt(dx * dx + dy * dy);
+
+ return new RectangleR(minX, minY, maxX - minX, maxY - minY);
+ }
+
+ public static double Distance(PointR p1, PointR p2)
+ {
+ double dx = p2.X - p1.X;
+ double dy = p2.Y - p1.Y;
+ return Math.Sqrt(dx * dx + dy * dy);
}
// compute the centroid of the points given
@@ -86,8 +87,8 @@ public static double AngleInDegrees(PointR start, PointR end, bool positiveOnly)
// by the circle centered on the start point with a radius to the end point,
// where 0 radians is straight right from start (+x-axis) and PI/2 radians is
// straight down (+y-axis).
- public static double AngleInRadians(PointR start, PointR end, bool positiveOnly)
- {
+ public static double AngleInRadians(PointR start, PointR end, bool positiveOnly)
+ {
double radians = 0.0;
if (start.X != end.X)
{
@@ -105,15 +106,15 @@ public static double AngleInRadians(PointR start, PointR end, bool positiveOnly)
radians += Math.PI * 2.0;
}
return radians;
- }
+ }
public static double Rad2Deg(double rad)
- {
- return (rad * 180d / Math.PI);
- }
+ {
+ return (rad * 180d / Math.PI);
+ }
- public static double Deg2Rad(double deg)
- {
+ public static double Deg2Rad(double deg)
+ {
return (deg * Math.PI / 180d);
}

0 comments on commit 450e61b

Please sign in to comment.