Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public method calculateArea() {
- Node n = this.head;
- while (0 != n)
- {
- if (0 == n.prev)
- {
- this.area += (this.property_originX + n.relativeX * this.cos) * (this.property_originY + this.head.relativeY * this.sin);
- this.area -= (this.property_originY + n.relativeY * this.sin) * (this.property_originX + this.head.relativeX * this.cos);
- }
- else
- {
- this.area += (this.property_originX + n.relativeX * this.cos) * (this.property_originY + n.prev.relativeY * this.sin);
- this.area -= (this.property_originY + n.relativeY * this.sin) * (this.property_originX + n.prev.relativeX * this.cos);
- }
- n = n.prev;
- }
- this.area = area / 2.;
- BJDebugMsg("Area: " + R2S(this.area));
- }
Add Comment
Please, Sign In to add comment