comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Displaying 3-D vector fields
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Displaying 3-D vector fields [message #32802 is a reply to message #32726] Thu, 07 November 2002 23:38 Go to previous messageGo to previous message
rmw092001 is currently offline  rmw092001
Messages: 17
Registered: January 2002
Junior Member
jim.blackwell@gsfc.nasa.gov (Jim) wrote in message news:<95167173.0211061237.389f387a@posting.google.com>...
> Hi all,
>
> After playing with several pieces of code I've found in the archives,
> and not having any luck, I figured I'd ask someone here.
>
> I have X, Y, Z points in space with a,b,c vector component values.
> I'd like to plot these in 3-D space. The data points are in the form
> of a rectangular regularly spaced grid.
>
> Any help would be appreciated
>
> Jim Blackwell

This plots an arrow in a 3d plot, at any Z value, however the arrow is
'parallel' to the XY plane...

pro arrow_3d,xcen,ycen,z,a,arrowsize,thick=thick,color=color

; plots an arrow on a 3d plot
; arrowhead is in the horizontal, xy plane
;
; INPUT PARAMETERS:
; xcen, ycen = starting point of arrow in data coordinates
; z = height of arrow above xy plane in data coordinates
; a = angle, degrees c/clockwise from +X direction, in xy plane
;
; OPTIONAL INPUT PARAMETERS:
; thick = usual IDL meaning, default = 2.0
; color = usual IDL meaning, default = !P.COLOR
;
; MODIFICATION HISTORY:
; merged from one_arrow.pro and one_ray.pro, 15 Aug 2002

dtr=!pi/180.

if N_params() LT 5 then begin
print,'Err: arrow_3d,xcen,ycen,z,angle,arrowsize,[,thick=,color=]'
return
endif

if not keyword_set(thick) then thick = 2.0
if not keyword_set(color) then color = !P.COLOR

; forward half of arrow stalk
plots,[xcen,xcen+arrowsize*cos(a*dtr)/2.],$
[ycen,ycen+arrowsize*sin(a*dtr)/2.],$
[z,z], color=color, thick=thick, /t3d
; backward half of arrow stalk
plots,[xcen,xcen-arrowsize*cos(a*dtr)/2.],$
[ycen,ycen-arrowsize*sin(a*dtr)/2.],$
[z,z], color=color, thick=thick, /t3d
; move to arrow head
xcen=xcen+arrowsize*cos(a*dtr)/2.
ycen=ycen+arrowsize*sin(a*dtr)/2.
; plot arrow head
; it's 1/3 the length of stalk, at angle 35 degrees -
plots,[xcen,xcen+arrowsize*cos((180.+a+35.)*dtr)/3.],$
[ycen,ycen+arrowsize*sin((180.+a+35.)*dtr)/3.],$
[z,z], color=color, thick=thick, /t3d
plots,[xcen,xcen+arrowsize*cos((180.+a-35.)*dtr)/3.],$
[ycen,ycen+arrowsize*sin((180.+a-35.)*dtr)/3.],$
[z,z], color=color, thick=thick, /t3d
return
end
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: use of 'obj_new' within another object definition
Next Topic: IdlGrPolygon - Intersection with planes and lines

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 16:08:04 PDT 2025

Total time taken to generate the page: 0.72192 seconds