开发者

Area of polygon - clockwise

From this threa Det开发者_JAVA百科ermine the centroid of multiple points I came to know that area of polygon can also be negative if we start in clockwise direction. Why it can be negative?


It is a product of the maths. You can use the sign if you wish to, or use an absolute value for the area.

You often get a similar effect with dot products and cross products. This can be effective, for example determining the orientation of a polygon in 3d (does the 'outside' side of the polygon face towards me or away from me?)


The sign tells you some useful information, that you can either use or discard. For example, what is the area below the curve sin(x) and above the x axis, for x over the interval [0,pi]. Yes, this is simply a definite integral. In MATLAB, I'd do it as:

>> quad(@sin,0,pi)
ans =
            2

But suppose I computed that same definite integral, with limits of integration [pi,0]? Clearly, we would get -2.

>> quad(@sin,pi,0)
ans =
           -2

And of course this makes sense. In either case, we can assure that we get the positive area by ignoring the sign. But the sign tells us something in that integral.

The sign computed for the area of a polygon is indeed useful in some problems. In the case of a triangle, a cross product will yield a vector that points in the direction orthogonal to the plane of the triangle containing the vectors. The magnitude of the vector will be twice the area of that triangle. Note that this vector can point in one of two directions orthogonal to a given plane, which one is indicated by the right hand rule. You can think of that sign as indicating which direction the vector pointed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜