package com.imdroid.sideslope.bd;

import lombok.Data;

@Data
public class Point {
    private double x;
    private double y;
    private double z;
    private double xDistance; //水平距离
    private double yDistance; //垂直距离
    private double zDistance; //垂直距离

    public Point(double x, double y, double z) {
        this.x = x;
        this.y = y;
        this.z = z;
    }

    public Point plus(Point p){
        return new Point(x+p.x, y+p.y, z+p.z);
    }

    public Point minus(Point p){
        return new Point(x-p.x, y-p.y, z-p.z);
    }

    public Point minusAbs(Point p){
        return new Point(Math.abs(x-p.x), Math.abs(y-p.y), Math.abs(z-p.z));
    }

    public Point times(double t){
        return new Point(x*t, y*t, z*t);
    }

    public Point div(double t){
        return new Point(x/t, y/t, z/t);
    }

}
