encapsulation of a point in Cartesian space of two dimensions

2

I created a ponto2d class with the attributes x and y, I created the get and set methods, until ai blz, then created a retângulo class with width and height, I need to know the value of a point in the two dimensional Cartesian space.

    
asked by anonymous 18.04.2014 / 04:09

1 answer

1

As I understand it, your own class is a POJO , that is, it's a class we use to carry data from one method to another, and instead of passing X and Y at all times, only passing its class ponto2d as a parameter.

A good base is the very Point2D class JDK: itself represents a point and is used as the base value for a Cartesian point by other geometry classes.

That is, if you have a triangle, you will have 3 dot2d objects to represent Cartesian points.

    
18.04.2014 / 13:32