public FloatVector multiply(Vector <float> vector) { Vector <float> newVector = base.Clone(); for (int i = 0; i < newVector.length; i++) { newVector[i] *= vector[i]; } return(FloatVector.fromVectorOfFloat(newVector)); }
public Screw project(Projector projector, bool toFinalBase = true) { FloatVector screwWrench = this.getWrench(); FloatVector screwTwist = this.getTwist(); screwWrench = projector.project(screwWrench, toFinalBase); screwTwist = projector.project(screwTwist, toFinalBase); Screw screw = Screw.fromWrenchAndTwist(screwWrench, screwTwist, projector.project(this.aplicationPoint, toFinalBase)); return(screw); }
public FloatVector vectorialProduct(Vector <float> vector) { { Vector <float> newVector = this.Clone(); for (int i = 0; i < this.length; i++) { newVector[i] *= this[Modulo.posModulo(i + 1, this.length)] * vector[Modulo.posModulo(i + 2, this.length)] - this[Modulo.posModulo(i + 2, this.length)] * vector[Modulo.posModulo(i + 1, this.length)]; } return(FloatVector.fromVectorOfFloat(newVector)); } }
public Screw changeApplicationPoint(FloatVector point) { if (this.aplicationPoint == null) { throw new NoApplicationPointException(); } FloatVector wrench = this.getWrench(); FloatVector twist = this.getTwist(); FloatVector oldPoint = this.aplicationPoint; FloatVector newPoint = point; twist = twist.add(newPoint.substract(oldPoint).vectorialProduct(wrench)); return(Screw.fromWrenchAndTwist(wrench, twist, newPoint)); }
public Screw(float[] coordinates, FloatVector applicationPoint) : base(coordinates) { this.aplicationPoint = applicationPoint; }
public static Screw fromWrenchAndTwist(FloatVector wrench, FloatVector twist, FloatVector applicationPoint) { return(new Screw(wrench.coordinates.Take(3).Concat(twist.coordinates.Take(3)).ToArray(), applicationPoint)); }