/** * Redefines this line segment with new endpoints. * * @param firstEndpoint new endpoint of this line segment. Not modified * @param secondEndpoint new second endpoint of this line segment. Not modified. */ default void set(Point3DReadOnly firstEndpoint, Point3DReadOnly secondEndpoint) { setFirstEndpoint(firstEndpoint); setSecondEndpoint(secondEndpoint); }
/** * Redefines this line segments with new endpoints. * * @param firstEndpointX x-coordinate of the new first endpoint. * @param firstEndpointY y-coordinate of the new first endpoint. * @param firstEndpointZ z-coordinate of the new first endpoint. * @param secondEndpointX x-coordinate of the new second endpoint. * @param secondEndpointY y-coordinate of the new second endpoint. * @param secondEndpointZ z-coordinate of the new second endpoint. */ default void set(double firstEndpointX, double firstEndpointY, double firstEndpointZ, double secondEndpointX, double secondEndpointY, double secondEndpointZ) { setFirstEndpoint(firstEndpointX, firstEndpointY, firstEndpointZ); setSecondEndpoint(secondEndpointX, secondEndpointY, secondEndpointZ); }
/** * Swaps this line segment's endpoints. */ default void flipDirection() { double x = getFirstEndpointX(); double y = getFirstEndpointY(); double z = getFirstEndpointZ(); setFirstEndpoint(getSecondEndpoint()); setSecondEndpoint(x, y, z); }