Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #2860

Re: 3D trajectory with rotation information

From Ethan A Merritt <sfeam@users.sourceforge.net>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: 3D trajectory with rotation information
Date 2015-04-02 12:20 -0700
Organization gnuplot development
Message-ID <mfk4ou$g51$1@dont-email.me> (permalink)
References <e22def23-5e07-472a-b0fd-a3f400fdddd3@googlegroups.com>

Show all headers | View raw


Jaydev Mehta wrote:

> I want to do this << www.youtube.com/watch?v=6ijArKE8vKU >>
> I have data file with 6 columns (x,y,z,alpha,beta,gama).
> I don't want to animate.
> I want just final plot at the end which shows each point's position as
> well as rotation. Please guide me.

I'll just block it out, but you'll have to fill in all the
matrix multiplication functions.

Your final plot command will be like this
    set style data vector
    splot 'data' using 1:2:3:($1 + X1($4,$5,$6)):($2 + X2($4,$5,$6)):($3 + X3($4,$5,$6)) lc "blue", \
          'data' using 1:2:3:($1 + Y1($4,$5,$6)):($2 + Y2($4,$5,$6)):($3 + Y3($4,$5,$6)) lc "green", \
          'data' using 1:2:3:($1 + Z1($4,$5,$6)):($2 + Z2($4,$5,$6)):($3 + Z3($4,$5,$6)) lc "red"

That will make three passes through your data, plotting successively
the transformed X, Y, and Z axes.

The annoying part is having to define the functions 
X1(alpha,beta,gamma) and so on.

Let us define M_αβγ as the 3x3 rotation matrix described by
angles alpha, beta, gamma.  The vector X_αβγ is found by
multiplying the unit X vector [1,0,0] by the matrix M_αβγ.

   X_αβγ = [1,0,0] M_αβγ

This vector itself has three components X = [X1, X2, X3]
and these are the terms that appear in the plot command.
Similarly for rotation of the unit Y and Z vectors.

	Ethan

Back to comp.graphics.apps.gnuplot | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

3D trajectory with rotation information Jaydev Mehta <jaydevmmehta@gmail.com> - 2015-04-01 12:57 -0700
  Re: 3D trajectory with rotation information Karl <mail.kfr@gmx.net> - 2015-04-02 20:22 +0200
  Re: 3D trajectory with rotation information Ethan A Merritt <sfeam@users.sourceforge.net> - 2015-04-02 12:20 -0700

csiph-web