We are about to switch to a new forum software. Until then we have removed the registration on this forum.

- All Categories 25.7K
- Announcements & Guidelines 13
- Common Questions 30
- Using Processing 22.1K
- Programming Questions 12.2K
- Questions about Code 6.4K
- How To... 4.2K
- Hello Processing 72
- GLSL / Shaders 292
- Library Questions 4K
- Hardware, Integration & Other Languages 2.7K
- Kinect 668
- Arduino 1K
- Raspberry PI 188
- Questions about Modes 2K
- Android Mode 1.3K
- JavaScript Mode 413
- Python Mode 205
- Questions about Tools 100
- Espanol 5
- Developing Processing 548
- Create & Announce Libraries 211
- Create & Announce Modes 19
- Create & Announce Tools 29
- Summer of Code 2018 93
- Rails Girls Summer of Code 2017 3
- Summer of Code 2017 49
- Summer of Code 2016 4
- Summer of Code 2015 40
- Summer of Code 2014 22
- p5.js 1.6K
- p5.js Programming Questions 947
- p5.js Library Questions 315
- p5.js Development Questions 31
- General 1.4K
- Events & Opportunities 289
- General Discussion 365

Hi, how to convert in Processing an Latitude and Longitude for example: 43.324 to 43° 32' 14'' 628.034 to 006° 28' 20''

Thank you a lot

Tagged:

## Answers

Your example is wrong :)

Step to convert from decimal degree to sexagesimal degree:

1) The integer part of decimal of degrees will remain the same.

(i.e. 43.324 start with 43°)

2) Multiply the decimal by 60.

(i.e. 0.324 * 60 = 19.44)

The integer part becomes the minutes (i.e. 19').

3) Take the remaining decimal and multiply by 60. (i.e. 0.44 * 60 = 26.4)

The resulting number becomes the seconds (i.e. 26.4"). Seconds can remain as a decimal.

Solution: 43.324 --> 43° 19' 26.4"

Now you must format the output to get

`043° 19' 26.4"`

I'm sorry cameyo, but how to write this sysntax in processing ? I'm new in Processing

Regards, Fred

Your conversion is not correct above. And the value for longitude is not correct. Check this: https://www.thoughtco.com/decimal-degrees-conversion-1434592

Here below is an example code to do the conversion.

Kf

kfrajer, thank you for your help