octave-bug-tracker
[Top][All Lists]

## [Octave-bug-tracker] [bug #55782] Request adding function to convert qua

 From: Rick T Subject: [Octave-bug-tracker] [bug #55782] Request adding function to convert quaternion to rotation matrix be added to quaternion package Date: Mon, 25 Feb 2019 18:23:36 -0500 (EST) User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/71.0.3578.98 Chrome/71.0.3578.98 Safari/537.36

```URL:
<https://savannah.gnu.org/bugs/?55782>

Summary: Request adding function to convert quaternion to
rotation matrix be added to quaternion package
Project: GNU Octave
Submitted by: ratulloch
Submitted on: Mon 25 Feb 2019 11:23:34 PM UTC
Category: Octave Forge Package
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Feature Request
Status: None
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: other
Operating System: GNU/Linux

_______________________________________________________

Details:

Requesting that a function to convert quaternion to matrix be added.  There is
a matrix to quaternion (rotm2q.m) but not the other way around.

Some example code like this could be added:

function [Rt]=q2rotm(qt)

s=qt(1);
vx=qt(2);
vy=qt(3);
vz=qt(4);

i1j1=1-2*vy^2-2*vz^2;
i1j2=2*vx*vy-2*s*vz;
i1j3=2*vx*vz+2*s*vy;
i2j1=2*vx*vy+2*s*vz;
i2j2=1-2*vx^2-2*vz^2;
i2j3=2*vy*vz-2*s*vx;
i3j1=2*vx*vz-2*s*vy;
i3j2=2*vy*vz+2*s*vx;
i3j3=1-2*vx^2-2*vy^2;

Rt=[i1j1 i1j2 i1j3;i2j1 i2j2 i2j3;i3j1 i3j2 i3j3];

_______________________________________________________

<https://savannah.gnu.org/bugs/?55782>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

```