Wrong area calculation objective-c?
问题 I have an array with 5 CGPoints (v0, v1, v2, v3, v4) which are the vertex of the shape implemented like this: _arrayVertex = [[NSMutableArray alloc] initWithObjects:[NSValue valueWithCGPoint:v0], [NSValue valueWithCGPoint:v1], [NSValue valueWithCGPoint:v2], [NSValue valueWithCGPoint:v3], [NSValue valueWithCGPoint:v4], nil]; Then, I calculate the area with those points: - (float)calculateArea { float area = 0; int N = (int)_arrayVertex.count; for (int i = 0; i < N-1; i++) { float term = ([