Skip to content

Commit

Permalink
ENG-10247 Deprecate GeographyPointValue algebra methods (#4929)
Browse files Browse the repository at this point in the history
  • Loading branch information
yzhang1991 committed Oct 13, 2017
1 parent 763a8e8 commit dfae47c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/frontend/org/voltdb/types/GeographyPointValue.java
Expand Up @@ -370,6 +370,7 @@ private static double normalize(double v, double range) {
* @param alpha Coordinates of offset will be scaled by this much.
* @return A new point offset by the scaled offset.
*/
@Deprecated
public GeographyPointValue add(GeographyPointValue offset, double alpha) {
// The addition of 0.0 converts
// -0.0 to 0.0.
Expand All @@ -383,6 +384,7 @@ public GeographyPointValue add(GeographyPointValue offset, double alpha) {
* @param offset The offset to add to this.
* @return A new point which is this plus the offset.
*/
@Deprecated
public GeographyPointValue add(GeographyPointValue offset) {
return add(offset, 1.0);
}
Expand All @@ -393,6 +395,7 @@ public GeographyPointValue add(GeographyPointValue offset) {
* @param offset The offset to subtract from this.
* @return A new point translated by -offset.
*/
@Deprecated
public GeographyPointValue sub(GeographyPointValue offset) {
return add(offset, -1.0);
}
Expand All @@ -405,6 +408,7 @@ public GeographyPointValue sub(GeographyPointValue offset) {
* @param scale The amount by which to scale the offset point.
* @return A new point translated by -offset.
*/
@Deprecated
public GeographyPointValue sub(GeographyPointValue offset, double scale) {
return add(offset, -1.0 * scale);
}
Expand All @@ -415,6 +419,7 @@ public GeographyPointValue sub(GeographyPointValue offset, double scale) {
* @param alpha The amount by which to scale this.
* @return The scaled point.
*/
@Deprecated
public GeographyPointValue mul(double alpha) {
return GeographyPointValue.normalizeLngLat(getLongitude() * alpha + 0.0,
getLatitude() * alpha + 0.0);
Expand All @@ -427,6 +432,7 @@ public GeographyPointValue mul(double alpha) {
* @param center The center of rotation.
* @return A new, rotated point.
*/
@Deprecated
public GeographyPointValue rotate(double phi, GeographyPointValue center) {
double sinphi = Math.sin(2*Math.PI*phi/360.0);
double cosphi = Math.cos(2*Math.PI*phi/360.0);
Expand All @@ -449,6 +455,7 @@ public GeographyPointValue rotate(double phi, GeographyPointValue center) {
* @param alpha The scale factor.
* @return The scaled point.
*/
@Deprecated
public GeographyPointValue scale(GeographyPointValue center, double alpha) {
return GeographyPointValue.normalizeLngLat(alpha*(getLongitude()-center.getLongitude()) + center.getLongitude(),
alpha*(getLatitude()-center.getLatitude()) + center.getLatitude());
Expand Down

0 comments on commit dfae47c

Please sign in to comment.