Message Boards Message Boards

0
|
6102 Views
|
2 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Converting 2-argument ArcTan to 1-argument ArcTan

ArcTan comes in two flavors

ArcTan[z]

and

ArcTan[x,y]

When x>0 and y>0

ArcTan[x,y]

can be simplified to

ArcTan[y/x]

How can I tell Mathematica that this is what I want?

POSTED BY: Erich Neuwirth
2 Replies
Posted 10 years ago

If you give ArcTan integer values it looks like it automatically does this. If you just give it variables x and y it doesn't do this by default. But you can use replacement with a rule to do this.

In[1]:= ArcTan[3, 7]

Out[1]= ArcTan[7/3]

In[2]:= ArcTan[x, y]

Out[2]= ArcTan[x, y]

In[3]:= ArcTan[x, y] /. ArcTan[x_, y_] -> ArcTan[y/x]

Out[3]= ArcTan[y/x]
POSTED BY: Bill Simpson

It looks like you would like this for syntactical purposes of using your own notation. Although, it might make solving some problems easier with simpler relations, plotting and in use of solver functions. Simply define your own function:

c=3
d=4
ArcTan1[y_]=ArcTan[y/c]
ArcTan2[x_]=ArcTan[d/x]

Then you can plot or solve for the values you need relationally on an as needed basis with the appropriate. If there is a particular application that you have in mind or need a solution for, please add to the discussion.

POSTED BY: Guy Mongelli
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract