GithubHelp home page GithubHelp logo

quaternions's Introduction

% given a quaternion [X, Y, Z] from MR3 that we want to be the β€œzero” orientation
zeroQuat = [-0.4067, -0.5282, -0.4345]
 
% the quaternion helper functions require the format [W X Y Z]
% so we use a helper function calculate W = SQRT(MAX(0,1-(X*X+Y*Y+Z*Z)))
% and build the full quaternion
zeroQuat = q3to4(zeroQuat)
 
% now we need to find the inverse of zeroQuat
calQuat = qinverse(zeroQuat)
 
% now we can transform any further quaternions by calQuat to get a rotation
% from the zero orientation
 
% first let's check that the zero scheme works by applying it to the quaternion we
% used to create it.  we should get the identity quaternion (no rotation)
% [1 0 0 0]
z = qtransform(zeroQuat, calQuat)
 
% now let's apply it to another quaternion that has a small delta from the
% zero orientation
testQuat = [-0.4046             -0.5313  -0.4285]
testQuat = q3to4(testQuat)
 
% apply zero to find delta from zero orientation
zeroedTestQuat = qtransform(testQuat, calQuat)

quaternions's People

Contributors

avinashparnandi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.