Print at Dec 20, 2025, 2:09:39 PM

Posted by bandara at Jul 10, 2011, 7:20:39 PM
Re: how to get area of room
float s1[][] = { { 0, 0 }, { 0, 4 }, { 4, 0 }, { 4, 4 } };
Room newRoom = new Room(s1);
float s2[][] = newRoom.getPoints();
Room r1=new Room(s2);
area=r1.getArea();
JOptionPane.showMessageDialog(null, area);

//this result 8.0 always, for all shapes of rooms (this 8 mean half area calculated from given s1),
But this is not what i need. I need to get the area of room which i draw in sweethome 3d.
If we have to parse values manually, what is the need of having getPoint and getArea method. Please help me in this.