Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
calculate arctan

Subject: calculate arctan

From: David Edson

Date: 11 Jun, 2009 14:24:02

Message: 1 of 2

Dears,

I want to calculate the angle the individual xy coordinates make from the centroid of the following set of points. I calculated the angle alpha=atan(XY(:,2)./XY(:,1)).
But the values I get does not represent the geometry. How could I can calculate alpha corrrectly?


XY=[ -1.0439 -0.3486
   -0.9836 -0.4650
   -0.9060 -0.5512
   -0.8198 -0.6374
   -0.7163 -0.7107
   -0.5568 -0.7538
   -0.4275 -0.7538
   -0.3284 -0.7409
   -0.2120 -0.6805
   -0.1129 -0.6288
   -0.0482 -0.5728
    0.0380 -0.5426
    0.1156 -0.5297
    0.2018 -0.5685
    0.2966 -0.6245
    0.4001 -0.6719
    0.4949 -0.6848
    0.5639 -0.6848
    0.6803 -0.6719
    0.7579 -0.6331
    0.8699 -0.5642
    0.9173 -0.5124
    0.9863 -0.4305
    1.0510 -0.3486
    1.0811 -0.2150
    1.0941 -0.1029
    1.0941 0.0264
    1.0639 0.1643
    1.0380 0.2290
    0.9604 0.3712
    0.8699 0.4790
    0.7320 0.5953
    0.6070 0.6729
    0.4691 0.7290
    0.3096 0.7591
    0.0725 0.7548
   -0.0697 0.7505
   -0.2077 0.7376
   -0.3758 0.6945
   -0.5094 0.6686
   -0.6473 0.5997
   -0.7508 0.5393
   -0.9146 0.3928
   -1.0008 0.2462
   -1.0784 0.0350
   -1.0999 -0.0943
   -1.0913 -0.2452
   -1.0439 -0.3486];
thanks,

TE

Subject: calculate arctan

From: John D'Errico

Date: 11 Jun, 2009 15:28:02

Message: 2 of 2

"David Edson" <tojadeb@example.com> wrote in message <h0r422$7gp$1@fred.mathworks.com>...
> Dears,
>
> I want to calculate the angle the individual xy coordinates make from the centroid of the following set of points. I calculated the angle alpha=atan(XY(:,2)./XY(:,1)).
> But the values I get does not represent the geometry. How could I can calculate alpha corrrectly?
>
>
> XY=[ -1.0439 -0.3486
> -0.9836 -0.4650
> -0.9060 -0.5512

help atan2

John

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us