/** * Sets the position of the {@link Advancement}. * * @param position The position */ default void setPosition(Vector2d position) { setPosition(position.getX(), position.getY()); }
Vector2d v2 = Vector2d.UNIT_X.mul(distance); final double pitchRad = Math.acos(v1.dot(v2) / (v1.length() * v2.length())); final double pitchDeg = pitchRad * 180 / Math.PI * (-v1.getY() / Math.abs(v1.getY())); p2 = xz2; v1 = p2.sub(p1); v2 = Vector2d.UNIT_Y.mul(v1.getY()); double yawRad = Math.acos(v1.dot(v2) / (v1.length() * v2.length())); double yawDeg = yawRad * 180 / Math.PI; if (v1.getX() < 0 && v1.getY() < 0) { yawDeg = 180 - yawDeg; } else if (v1.getX() > 0 && v1.getY() < 0) { yawDeg = 270 - (90 - yawDeg); } else if (v1.getX() > 0 && v1.getY() > 0) { yawDeg = 270 + (90 - yawDeg);
public Vector4d(Vector2d v, double z, double w) { this(v.getX(), v.getY(), z, w); }
public Vector4d(Vector2d v, double z, double w) { this(v.getX(), v.getY(), z, w); }
public Vector3d(Vector2d v, double z) { this(v.getX(), v.getY(), z); }
public VectorNd(Vector2d v) { this(v.getX(), v.getY()); }
public Vector3d(Vector2d v, double z) { this(v.getX(), v.getY(), z); }
/** * Rotates a vector by this complex. * * @param v The vector to rotate * @return The rotated vector */ public Vector2d rotate(Vector2d v) { return rotate(v.getX(), v.getY()); }
/** * Rotates a vector by this complex. * * @param v The vector to rotate * @return The rotated vector */ public Vector2d rotate(Vector2d v) { return rotate(v.getX(), v.getY()); }
public static Matrix3d createTranslation(Vector2d v) { return createTranslation(v.getX(), v.getY()); }
public Vector2d transform(Vector2d v) { return transform(v.getX(), v.getY()); }
public static Matrix2d createScaling(Vector2d v) { return createScaling(v.getX(), v.getY()); }
public static Matrix2d createScaling(Vector2d v) { return createScaling(v.getX(), v.getY()); }
public Vector2d transform(Vector2d v) { return transform(v.getX(), v.getY()); }
public Matrix3d translate(Vector2d v) { return translate(v.getX(), v.getY()); }
public Matrix2d scale(Vector2d v) { return scale(v.getX(), v.getY()); }
public static Matrix3d createTranslation(Vector2d v) { return createTranslation(v.getX(), v.getY()); }
public Matrix3d translate(Vector2d v) { return translate(v.getX(), v.getY()); }
public static JsonObject serialize(Vector2d vector2d) { return JsonBuilder.object() .add("x", vector2d.getX()) .add("y", vector2d.getY()) .build(); }
public static JsonObject serialize(Vector2d vector2d) { return JsonBuilder.object() .add("x", vector2d.getX()) .add("y", vector2d.getY()) .build(); }