Android Question Radian function and degrees

henry montoya

Member
Licensed User
Longtime User
Hi.

I'm trying to convert degrees, minutes, seconds to radians.
someone knows how to implement the function radians and degrees or if there is any equivalent function to B4A.

Thank you very much for your answers
 

wonder

Expert
Licensed User
Longtime User
You can find everything that you need below:
http://www.purplemath.com/modules/radians.htmhttp://www.purplemath.com/modules/radians.htm

Decimal Degrees and DMS


When you work with degrees, you'll almost always be working with decimal degrees; that is, with degrees expressed as decimal numbers such as 43.1025°. But just as "1.75" hours can be expressed as "1 hour and 45 minutes", so also "degrees" can be expressed in terms of smaller units. These units, just as for "hours", are called "minutes" and "seconds". Just as "hours" can be expressed as decimals or else as hours - minutes - seconds, so also "degrees" can be expressed as decimals or else as degrees - minutes - seconds, denoted as "DMS".

  • Convert 43.1025° to DMS form.
    I can see that I have 43°, but what do I do with the "0.1025" part? I treat it like a percentage of the sixty minutes in one degree, and find out how many minutes this is:

    • (0.1025 degrees)(60 minutes / 1 degree) = 6.15 minutes
    ...or 6 minutes and 0.15 of a minute. Each minute has sixty seconds, so:

    • (0.15 minutes)(60 seconds / 1 minute) = 9 seconds

  • Then 43.1025° = 43° 6' 9"
Notice the symbols: A single quote-mark (an apostrophe) indicates "minutes" and a double quote-mark indicates "seconds". This is similar to the notation (in Imperial measurements) for "feet" and "inches": the smaller unit gets the more-substantial mark.

  • Convert 102° 45' 54" to decimal form.
    Clearly, I've got 102°, but how do I convert the minutes and seconds to decimal form? By using the definitions and doing the divisions. The 45' means 45/60 of a degree, since each degree contains sixty minutes. Simplification and long division gives me 45/60 = 3/4 = 0.75. So the 45' is 0.75°.

    Now I need to deal with the 54". Since each minute is sixty seconds, then I get 54/60 = 9/10 = 0.9. But this is minutes. Now I need to convert the 0.9 of a minute to degrees:

    • (0.9 minutes)(1 degree / 60 minutes) = 0.015 degrees
    So 102° 45' 54" = 102° + 0.75° + 0.015° = 102.765°.
Radians

Why do we have to learn radians, when we already have perfectly good degrees? Because degrees, technically speaking, are not actually numbers, and we can only do math with numbers. This is somewhat similar to the difference between decimals and percentages. Yes, "83%" has a clear meaning, but to do mathematical computations, you first must convert to the equivalent decimal form, 0.83. Something similar is going on here (which will make more sense as you progress further into calculus, etc).

The 360° for one revolution ("once around") is messy enough. Why is the value for one revolution in radians the irrational value 2π? Because this value makes the math work out right. You know that the circumference C of a circle with radius r is given by C = 2πr. If r = 1, then C = 2π. For reasons you'll learn later, mathematicians like to work with the "unit" circle, being the circle with r = 1. For the math to make sense, the "numerical" value corresponding to 360° needed to be defined as (that is, needed to be invented having the property of) "2π is the numerical value of 'once around'."

Converting Between Radians and Degrees

Each of radians and degrees has its place. If you're describing directions to me, I'd really rather you said, "Turn sixty degrees to the right when you pass the orange mailbox", rather than, "Turn one-third πradians" at that point. but if I need to find the area of a sector of a circle, I'd rather you gave me the numerical radian measure that I can plug directly into the formula, rather than the degree measure that I'd have to convert first.

But you won't always be given angle measures in the form you'd prefer, so you'll need to be able to convert between radians and degrees. To do this, you'll use the fact that 360° is "once around", and so is 2π. However, you'll use this fact in the form of the somewhat simplified correspondence of 180° to π.

  • Convert 270° to radians.
    Since 180° equates to π, then:

    • radians01.gif

    The equivalent angle is
    radians07.gif

  • Convert
    radians08.gif
    radians to degrees.

    • radians02.gif

    The equivalent angle is 30°
Note that the way I used the correspondence varied with what I was given. If I needed to end up with radians, I put π on top; if I needed to end up with degrees, I put 180° on top. That's all there is to that.
 
Upvote 0
Top