Program Listing for File SpatialVector.h

Program Listing for File SpatialVector.h#

Return to documentation for file (include/Karana/Math/SpatialVector.h)

/*
*Copyright(c)2024-2025KaranaDynamicsPtyLtd.Allrightsreserved.
*
*NOTICETOUSER:
*
*Thissourcecodeand/ordocumentation(the"LicensedMaterials")is
*theconfidentialandproprietaryinformationofKaranaDynamicsInc.
*UseoftheseLicensedMaterialsisgovernedbythetermsandconditions
*ofaseparatesoftwarelicenseagreementbetweenKaranaDynamicsandthe
*Licensee("LicenseAgreement").Unlessexpresslypermittedunderthat
*agreement,anyreproduction,modification,distribution,ordisclosure
*oftheLicensedMaterials,inwholeorinpart,toanythirdparty
*withoutthepriorwrittenconsentofKaranaDynamicsisstrictlyprohibited.
*
*THELICENSEDMATERIALSAREPROVIDED"ASIS"WITHOUTWARRANTYOFANYKIND.
*KARANADYNAMICSDISCLAIMSALLWARRANTIES,EXPRESSORIMPLIED,INCLUDING
*BUTNOTLIMITEDTOWARRANTIESOFMERCHANTABILITY,NON-INFRINGEMENT,AND
*FITNESSFORAPARTICULARPURPOSE.
*
*INNOEVENTSHALLKARANADYNAMICSBELIABLEFORANYDAMAGESWHATSOEVER,
*INCLUDINGBUTNOTLIMITEDTOLOSSOFPROFITS,DATA,ORUSE,EVENIF
*ADVISEDOFTHEPOSSIBILITYOFSUCHDAMAGES,WHETHERINCONTRACT,TORT,
*OROTHERWISEARISINGOUTOFORINCONNECTIONWITHTHELICENSEDMATERIALS.
*
*U.S.GovernmentEndUsers:TheLicensedMaterialsarea"commercialitem"
*asdefinedat48C.F.R.2.101,andareprovidedtotheU.S.Government
*onlyasacommercialenditemunderthetermsofthislicense.
*
*AnyuseoftheLicensedMaterialsinindividualorcommercialsoftwaremust
*include,intheuserdocumentationandinternalsourcecodecomments,
*thisNotice,Disclaimer,andU.S.GovernmentUseProvision.
*/


#pragmaonce

#include"Karana/Math/Defs.h"

namespaceKarana::Math{
classSpatialVector{
//Constructors
public:
SpatialVector();

SpatialVector(constVec6&sv);

SpatialVector(constVec3&w,constVec3&v);

//Copyandmoveoperations
public:
SpatialVector(constSpatialVector&other);

SpatialVector&operator=(constSpatialVector&other);

SpatialVector(SpatialVector&&other)noexcept;

SpatialVector&operator=(SpatialVector&&other)noexcept;

std::string_viewtypeString()const;

std::stringdumpString(std::string_viewprefix="",
unsignedintprecision=10,
boolexponential=false)const;

voiddump(std::string_viewprefix="",
unsignedintprecision=10,
boolexponential=false)const;

boolisZero(doubleprec=MATH_EPSILON)const;

voidsetZero();

voiduninitialize();

boolisInitialized()const;

//Operators
public:
booloperator==(constSpatialVector&other)const;

doubleoperator*(constSpatialVector&other)const;

SpatialVectoroperator*(doublescale)const;

SpatialVectoroperator+(constSpatialVector&other)const;

SpatialVector&operator+=(constSpatialVector&other);

SpatialVectoroperator-()const;

SpatialVectoroperator-(constSpatialVector&other)const;

SpatialVectoroperator-=(constSpatialVector&other);

SpatialVectoroperator+(constVec6&vec)const;

SpatialVectoroperator-(constVec6&vec)const;

//SpatialVectormethods
public:
boolisApprox(constSpatialVector&other,doubleprec=MATH_EPSILON)const;

constVec3&getw()const;

voidsetw(constVec3&w);

constVec3&getv()const;

voidsetv(constVec3&v);

Vec6toVector6()const;

SpatialVectorcross(constSpatialVector&other);

Mat66tilde()const;

SpatialVectorbarprod(constSpatialVector&other);

SpatialVectormultiplyFromLeft(constMat66&mat)const;

private:
Vec3_w;

Vec3_v;
};
}//namespaceKarana::Math