Guest User

Untitled

a guest
Jan 22nd, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. public method calculateArea() {
  2. Node n = this.head;
  3.  
  4. while (0 != n)
  5. {
  6. if (0 == n.prev)
  7. {
  8. this.area += (this.property_originX + n.relativeX * this.cos) * (this.property_originY + this.head.relativeY * this.sin);
  9. this.area -= (this.property_originY + n.relativeY * this.sin) * (this.property_originX + this.head.relativeX * this.cos);
  10. }
  11. else
  12. {
  13. this.area += (this.property_originX + n.relativeX * this.cos) * (this.property_originY + n.prev.relativeY * this.sin);
  14. this.area -= (this.property_originY + n.relativeY * this.sin) * (this.property_originX + n.prev.relativeX * this.cos);
  15. }
  16.  
  17. n = n.prev;
  18. }
  19.  
  20. this.area = area / 2.;
  21.  
  22. BJDebugMsg("Area: " + R2S(this.area));
  23. }
Add Comment
Please, Sign In to add comment