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:
Inverse cosine function returns a complex number

Subject: Inverse cosine function returns a complex number

From: Liana

Date: 5 Apr, 2011 20:21:02

Message: 1 of 4

Hello,

I need to compute the inverse cosine (in degrees) for x = 1.44. However, the function 'acosd' returns the complex number, because x>1. Does anybody know the built-in function to transform a complex number to degrees?
x = 1.44;
angle = acosd(x)

angle = 0 + 51.74i

Subject: Inverse cosine function returns a complex number

From: Liana

Date: 5 Apr, 2011 20:31:05

Message: 2 of 4

I had an error in my calculations. The problem is solved.

"Liana" wrote in message <inftje$ii2$1@fred.mathworks.com>...
> Hello,
>
> I need to compute the inverse cosine (in degrees) for x = 1.44. However, the function 'acosd' returns the complex number, because x>1. Does anybody know the built-in function to transform a complex number to degrees?
> x = 1.44;
> angle = acosd(x)
>
> angle = 0 + 51.74i

Subject: Inverse cosine function returns a complex number

From: Florin Neacsu

Date: 5 Apr, 2011 20:41:05

Message: 3 of 4

"Liana" wrote in message <inftje$ii2$1@fred.mathworks.com>...
> Hello,
>
> I need to compute the inverse cosine (in degrees) for x = 1.44. However, the function 'acosd' returns the complex number, because x>1. Does anybody know the built-in function to transform a complex number to degrees?
> x = 1.44;
> angle = acosd(x)
>
> angle = 0 + 51.74i

Hi

>Does anybody know the built-in function to transform a complex number to degrees?

I can't speak for everyone, but I surely don't.

If z is a comples number you can write z=r*exp(i*phi). So you have a radius and an angle (geometrical interpretation). I think phase/angle can give you the angle in radians (N.B. be careful at your variables names. angle is a matlab function).

Also if you have a look at acos you will see how the cos^{-1} is defined (acosd = 180/pi*acos actually)

Hope it helps,
Florin

Subject: Inverse cosine function returns a complex number

From: Liana

Date: 5 Apr, 2011 21:02:05

Message: 4 of 4

Thank you, I got the point.
"Florin Neacsu" <fneacsu2@gmail.com> wrote in message <infup1$9ld$1@fred.mathworks.com>...
> "Liana" wrote in message <inftje$ii2$1@fred.mathworks.com>...
> > Hello,
> >
> > I need to compute the inverse cosine (in degrees) for x = 1.44. However, the function 'acosd' returns the complex number, because x>1. Does anybody know the built-in function to transform a complex number to degrees?
> > x = 1.44;
> > angle = acosd(x)
> >
> > angle = 0 + 51.74i
>
> Hi
>
> >Does anybody know the built-in function to transform a complex number to degrees?
>
> I can't speak for everyone, but I surely don't.
>
> If z is a comples number you can write z=r*exp(i*phi). So you have a radius and an angle (geometrical interpretation). I think phase/angle can give you the angle in radians (N.B. be careful at your variables names. angle is a matlab function).
>
> Also if you have a look at acos you will see how the cos^{-1} is defined (acosd = 180/pi*acos actually)
>
> Hope it helps,
> Florin

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