Coordinate Conversions: Rectangular, Cylindrical, Spherical - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: HP Prime Software Library (/forum-15.html) +--- Thread: Coordinate Conversions: Rectangular, Cylindrical, Spherical (/thread-610.html) |
Coordinate Conversions: Rectangular, Cylindrical, Spherical - Eddie W. Shore - 02-04-2014 04:48 AM PLEASE SCROLL TO THE END OF THIS THREAD, the most recent version is there. Thanks, Eddie Code: EXPORT COORDCONV() Note: Sqrt(-1) is that "I" character (Shift+3). Eddie RE: Coordinate Conversions: Rectangular, Cylindrical, Spherical - Eddie W. Shore - 12-16-2014 01:38 PM (02-04-2014 04:48 AM)Eddie W. Shore Wrote: ** PLEASE IGNORE THIS PROGRAM - There is a problem with one of the commands (ARG) - apologizes for any inconvenience. Hope to have a working solution soon. Eddie RE: Coordinate Conversions: Rectangular, Cylindrical, Spherical - Han - 12-16-2014 02:11 PM Change sqrt(-1) to lower-case i (and ensure lower-case i is not declared as a local variable); or use the "i" character [Shift][3]. This will work around the possibility that users may not have enabled complex output from real input (page 1 in the Home settings). RE: Coordinate Conversions: Rectangular, Cylindrical, Spherical - Eddie W. Shore - 12-17-2014 05:05 AM (12-16-2014 02:11 PM)Han Wrote: Change sqrt(-1) to lower-case i (and ensure lower-case i is not declared as a local variable); or use the "i" character [Shift][3]. This will work around the possibility that users may not have enabled complex output from real input (page 1 in the Home settings). Thanks, Han. I works better now. Code: OK try this, use the lowercase "i" instead of the "i" from [Shift]+[3] or sqrt(-1). Seems to work. Please let me know. Thanks Luigi. RE: Coordinate Conversions: Rectangular, Cylindrical, Spherical - BERNARD MICHAUD - 03-23-2016 11:13 PM I notice that in the section below "ρ*COS(θ)];" should theta be replaced with 'phi'. I tried X=8, Y=6, Z=4 it returns 10.77, 68.2, 36.87. Working it in reverse = 8, 6, 8.62. That's 8.62 instead of 4. IF ch==6 THEN INPUT({ρ,θ,φ}); RETURN [ρ*COS(θ)*SIN(φ),ρ*SIN(θ)*SIN(φ), ρ*COS(θ)]; END; RE: Coordinate Conversions: Rectangular, Cylindrical, Spherical - Eddie W. Shore - 05-01-2016 04:26 PM Thank you Bernard. The corrected program below: Code: EXPORT COORDCONV() RE: Coordinate Conversions: Rectangular, Cylindrical, Spherical - BERNARD MICHAUD - 10-03-2016 11:51 PM Sorry Eddie if I misled you. What I mean is this. You have the first section below, but should be the second section. ρ*COS(θ)]; should be ρ*COS(φ)]; First section IF ch==6 THEN INPUT({ρ,θ,φ}); RETURN [ρ*COS(θ)*SIN(φ),ρ*SIN(θ)*SIN(φ), ρ*COS(θ)]; error END; Second section IF ch==6 THEN INPUT({ρ,θ,φ}); RETURN [ρ*COS(θ)*SIN(φ),ρ*SIN(θ)*SIN(φ), ρ*COS(φ)]; correct END; |