I'm getting the slope of a line bounded by two points
float slopeXY(CGPoint p1, CGPoint p2)
{
return ((p2.y - p1.y) / (p2.x - p1.x));
}
If I give it a zero-sized line,
CGPoint p1 = CGPointMake(0, 10);
CGPoint p2 = CGPointMake(0, 10);
float sxy = slopeXY(p1, p2);
I don't get a divide by zero error.