The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
atan2() Storing symbolic expression into numeric only vector object *Error*
09-03-2018, 10:06 PM (This post was last modified: 09-04-2018 12:52 AM by Magnus512.)
Post: #1
atan2() Storing symbolic expression into numeric only vector object *Error*
Hi there, I'm making my own program to change between coordinate systems:
-------------
EXPORT SPHERE;
//Rectangular to Spherical
//(x,y,z)-->(ρ,θ,φ)
EXPORT RECT2SPHE(CORD)
BEGIN
//Separacion de coordenadas en x,y y z.
LOCAL x:=CORD(1),y:=CORD(2),z:=CORD(3);
//Variables para guardar resultado temporal
LOCAL ρ:=0,θ:=0,φ:=0;
//Operaciones para convertir los valores
ρ:=SQRT((x)^2+(y)^2+(z)^2);
θ:=atan(y/x);
φ:=ACOS(z/ρ);
//Guardar el resultado en la variable global SPHERE
SPHERE:=[ρ,θ,φ];
RETURN("ρ="+ρ+" θ="+θ+" φ="+φ);
END;
---------------------------
This is a part of the code, but I have some torubles here, when I store the results into SPHERE variable using atan to get the angle (θ:=atan(y/x)) it works just perfect, but if I try to use atan2(y,x) I get this message
   
The error comes out when I use radian mode, but it works in degrees.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
atan2() Storing symbolic expression into numeric only vector object *Error* - Magnus512 - 09-03-2018 10:06 PM



User(s) browsing this thread: 1 Guest(s)