Has anyone know simple short code to convert this without use additional libraries ?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
Like this:
Edit: Added an Abs call so that it works for negative angles also.
you could use timespan: (tricky but it works)
I am infering from your question that you want to convert from cartesian to polar coordinates.
If this is the case, the basic formulae you need are:
Where r is the distance and θ is the angle from x = 0 (about the origin)
Does this help?
I came up with the following. It correctly handles negative coordinates (south latitude or west longitude) and returns the remainder (in degrees) that was not evely divided into minutes or seconds.