I'm trying to find the width and height of a rectangle using the lower left corner and the upper right corner in Hyperion, and I wanted to know if I was doing it right:

Code:
    public Dimension getDimension(Location lowerLeftPoint, Location upperRightPoint) {
        Location upperLeftPoint = Location.create(lowerLeftPoint.getX(), upperRightPoint.getY(), 0);
        Location lowerRightPoint = Location.create(upperRightPoint.getX(), lowerLeftPoint.getY(), 0);
        int diffWidth = lowerRightPoint.getX() - lowerLeftPoint.getX();
        int diffHeight = upperLeftPoint.getY() - lowerLeftPoint.getY();
        return new Dimension(diffWidth, diffHeight);
    }