/// <summary> /// Even Versor Product /// </summary> /// <param name="evenVersor"></param> /// <param name="mv"></param> /// <returns></returns> public GaSymMultivector EvenVersorProduct(GaSymMultivector evenVersor, GaSymMultivector mv) { var evenVersorReverse = evenVersor.Reverse(); var evenVersorNorm2Inverse = SymbolicUtils.Constants.One / Sp[evenVersor, evenVersorReverse][0] .ToMathematicaScalar(); var evenVersorInverse = evenVersorReverse * evenVersorNorm2Inverse; return(Gp[Gp[evenVersor, mv], evenVersorInverse]); }
/// <summary> /// Odd Versor Product /// </summary> /// <param name="oddVersor"></param> /// <param name="mv"></param> /// <returns></returns> public GaSymMultivector OddVersorProduct(GaSymMultivector oddVersor, GaSymMultivector mv) { var oddVersorReverse = oddVersor.Reverse(); var oddVersorNorm2Inverse = SymbolicUtils.Constants.One / Sp[oddVersor, oddVersorReverse][0] .ToMathematicaScalar(); var oddVersorInverse = oddVersorReverse * oddVersorNorm2Inverse; return(Gp[Gp[oddVersor, mv.GradeInv()], oddVersorInverse]); }
public IEnumerable <GaSymMultivector> RotorProduct(GaSymMultivector rotorVersor, IEnumerable <int> basisBladeIDs) { var rotorVersorInverse = rotorVersor.Reverse(); return(basisBladeIDs.Select(id => { var mv = GaSymMultivector.CreateBasisBlade(GaSpaceDimension, id); return Gp[Gp[rotorVersor, mv], rotorVersorInverse] .GetKVectorPart(id.BasisBladeGrade()); })); }
public IEnumerable <GaSymMultivector> EvenVersorProduct(GaSymMultivector evenVersor, IEnumerable <int> basisBladeIDs) { var evenVersorReverse = evenVersor.Reverse(); var evenVersorNorm2Inverse = SymbolicUtils.Constants.One / Sp[evenVersor, evenVersorReverse][0] .ToMathematicaScalar(); var evenVersorInverse = evenVersorReverse * evenVersorNorm2Inverse; return(basisBladeIDs.Select(id => { var mv = GaSymMultivector.CreateBasisBlade(GaSpaceDimension, id); return Gp[Gp[evenVersor, mv], evenVersorInverse] .GetKVectorPart(id.BasisBladeGrade()); })); }
/// <summary> /// Odd Versor Product of a list of basis blades given by their IDs /// </summary> /// <param name="oddVersor"></param> /// <param name="basisBladeIDs"></param> /// <returns></returns> public IEnumerable <GaSymMultivector> OddVersorProduct(GaSymMultivector oddVersor, IEnumerable <int> basisBladeIDs) { var oddVersorReverse = oddVersor.Reverse(); var oddVersorNorm2Inverse = SymbolicUtils.Constants.One / Sp[oddVersor, oddVersorReverse][0] .ToMathematicaScalar(); var oddVersorInverse = oddVersorReverse * oddVersorNorm2Inverse; return(basisBladeIDs.Select(id => { var mv = GaSymMultivector.CreateTerm( GaSpaceDimension, id, id.BasisBladeIdHasNegativeGradeInv() ? Expr.INT_MINUSONE : Expr.INT_ONE ); return Gp[Gp[oddVersor, mv], oddVersorInverse] .GetKVectorPart(id.BasisBladeGrade()); })); }
public static MathematicaScalar EMagnitude2(this GaSymMultivector mv) { return(ESp(mv, mv.Reverse())[0].ToMathematicaScalar()); }
/// <summary> /// Rotor Product /// </summary> /// <param name="rotorVersor"></param> /// <param name="mv"></param> /// <returns></returns> public GaSymMultivector RotorProduct(GaSymMultivector rotorVersor, GaSymMultivector mv) { return(Gp[Gp[rotorVersor, mv], rotorVersor.Reverse()]); }
public MathematicaScalar Norm2(GaSymMultivector mv) { return(Sp[mv, mv.Reverse()][0].ToMathematicaScalar()); }