Re: [R] 3D trajectory plot?

2008-11-15 Thread Michael Grant
Are you talking about a 'streamline' like might be made with 'vtk'? or in a 
number of fluid dynamics, groundwater packages, particle physics codes, etc.? 
There was an exploratory hook up of R and vtk by M. Kondrin a year or two back 
(linux only). Search the archives. Parsing a vtk dataset in R should relatively 
straight-forward.

HTH
Michael Grant



--- On Tue, 11/11/08, Chris Jarman [EMAIL PROTECTED] wrote:

 From: Chris Jarman [EMAIL PROTECTED]
 Subject: [R] 3D trajectory plot?
 To: r-help@r-project.org
 Date: Tuesday, November 11, 2008, 9:55 PM
 Hello,
 I'm attempting to create a smooth, 3D plot of a
 trajectory (rather
 than the cloud or wireframe functions).  I would rather the
 individual
 data points not be visible.  I've had no luck finding
 this on the
 graphics or help pages.  Thank you in advance.  Chris
 Some example data, just in case:
 
 2532  40
 1225  32
 2 12  25
 2 2   12
 202   2
 1 20  2
 6 1   20
 5 6   1
 5 5   6
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained,
 reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] 3D trajectory plot?

2008-11-14 Thread Yihui Xie
But it's not _smooth_ (as Chris asked for)... I also thought about the
plot3d(), but I don't know how to smooth the 3D points. AFAIK spline
functions only work for 2D cases in R? (Sorry I'm not familiar with
splines)

Regards,
Yihui
--
Yihui Xie [EMAIL PROTECTED]
Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086
Mobile: +86-15810805877
Homepage: http://www.yihui.name
School of Statistics, Room 1037, Mingde Main Building,
Renmin University of China, Beijing, 100872, China



On Wed, Nov 12, 2008 at 7:22 PM, Duncan Murdoch [EMAIL PROTECTED] wrote:
 Chris Jarman wrote:

 Hello,
 I'm attempting to create a smooth, 3D plot of a trajectory (rather
 than the cloud or wireframe functions).  I would rather the individual
 data points not be visible.  I've had no luck finding this on the
 graphics or help pages.  Thank you in advance.  Chris
 Some example data, just in case:

 25  32  40
 12  25  32
 2   12  25
 2   2   12
 20  2   2
 1   20  2
 6   1   20
 5   6   1
 5   5   6



 plot3d(x,y,z, type='l') from rgl.

 Duncan Murdoch


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] 3D trajectory plot?

2008-11-14 Thread Clint Bowman
In reading this thread the thought popped into my head.  A smooth
representation of the trajectory defined by the data in Chris's message
from Wednesday is very similar to the guidance problem of a rocket.  I
believe that guidance engineers use Kalman filters to smooth out noisy
data to generate the control signals to keep the missile on course.  Would
an such an approach work here to produce a smooth estimate to the
trajectory described by the data?

Clint

Clint BowmanINTERNET:   [EMAIL PROTECTED]
Air Dispersion Modeler  INTERNET:   [EMAIL PROTECTED]
Air Quality Program VOICE:  (360) 407-6815
Department of Ecology   FAX:(360) 407-7534

USPS:   PO Box 47600, Olympia, WA 98504-7600
Parcels:300 Desmond Drive, Lacey, WA 98503-1274

On Fri, 14 Nov 2008, Duncan Murdoch wrote:

 On 14/11/2008 3:10 AM, Yihui Xie wrote:
  But it's not _smooth_ (as Chris asked for)... I also thought about the
  plot3d(), but I don't know how to smooth the 3D points. AFAIK spline
  functions only work for 2D cases in R? (Sorry I'm not familiar with
  splines)

 There are lots of definitions of smooth.  One easy one is to use splines in
 each coordinate, with the independent variable being an implied time
 coordinate 1, 2, 3, etc.  That is (with only the first 4 points, I'm lazy):

 x - splinefun(1:4, c(25,12,2,2))
 y - splinefun(1:4, c(32,25,12,2))
 z - splinefun(1:4, c(40,32,25,12))

 times - seq(1, 4, len=200)
 plot3d(x(times), y(times), z(times), type=l)

 Duncan Murdoch

 
  Regards,
  Yihui
  --
  Yihui Xie [EMAIL PROTECTED]
  Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086
  Mobile: +86-15810805877
  Homepage: http://www.yihui.name
  School of Statistics, Room 1037, Mingde Main Building,
  Renmin University of China, Beijing, 100872, China
 
 
 
  On Wed, Nov 12, 2008 at 7:22 PM, Duncan Murdoch [EMAIL PROTECTED]
  wrote:
   Chris Jarman wrote:
Hello,
I'm attempting to create a smooth, 3D plot of a trajectory (rather
than the cloud or wireframe functions).  I would rather the individual
data points not be visible.  I've had no luck finding this on the
graphics or help pages.  Thank you in advance.  Chris
Some example data, just in case:
   
25  32  40
12  25  32
2   12  25
2   2   12
20  2   2
1   20  2
6   1   20
5   6   1
5   5   6
   
   
   plot3d(x,y,z, type='l') from rgl.
  
   Duncan Murdoch
  
 
  __
  R-help@r-project.org mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
  and provide commented, minimal, self-contained, reproducible code.

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] 3D trajectory plot?

2008-11-12 Thread Duncan Murdoch

Chris Jarman wrote:

Hello,
I'm attempting to create a smooth, 3D plot of a trajectory (rather
than the cloud or wireframe functions).  I would rather the individual
data points not be visible.  I've had no luck finding this on the
graphics or help pages.  Thank you in advance.  Chris
Some example data, just in case:

25  32  40
12  25  32
2   12  25
2   2   12
20  2   2
1   20  2
6   1   20
5   6   1
5   5   6

  

plot3d(x,y,z, type='l') from rgl.

Duncan Murdoch

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] 3D trajectory plot?

2008-11-11 Thread Chris Jarman
Hello,
I'm attempting to create a smooth, 3D plot of a trajectory (rather
than the cloud or wireframe functions).  I would rather the individual
data points not be visible.  I've had no luck finding this on the
graphics or help pages.  Thank you in advance.  Chris
Some example data, just in case:

25  32  40
12  25  32
2   12  25
2   2   12
20  2   2
1   20  2
6   1   20
5   6   1
5   5   6

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.