Click here to Skip to main content
15,889,615 members
Home / Discussions / C#
   

C#

 
GeneralRe: reduce image size Pin
Mycroft Holmes28-Mar-10 14:17
professionalMycroft Holmes28-Mar-10 14:17 
GeneralRe: reduce image size Pin
Luc Pattyn28-Mar-10 14:27
sitebuilderLuc Pattyn28-Mar-10 14:27 
QuestionXMLDocument for all MDI children Pin
Jassim Rahma27-Mar-10 12:52
Jassim Rahma27-Mar-10 12:52 
AnswerRe: XMLDocument for all MDI children Pin
Eslam Afifi27-Mar-10 13:42
Eslam Afifi27-Mar-10 13:42 
AnswerRe: XMLDocument for all MDI children Pin
Mustafa Ismail Mustafa28-Mar-10 0:48
Mustafa Ismail Mustafa28-Mar-10 0:48 
Questionrun save_changes for open children Pin
Jassim Rahma27-Mar-10 12:51
Jassim Rahma27-Mar-10 12:51 
AnswerRe: run save_changes for open children Pin
Eslam Afifi27-Mar-10 13:42
Eslam Afifi27-Mar-10 13:42 
AnswerDegrees, minutes and seconds to Decimal Degrees Pin
Darrall27-Mar-10 7:17
Darrall27-Mar-10 7:17 
I have been asking around to see if there is an existing class method in C# to do this and it appears not so I worked out my own methods if anyone is interested or needs them.

// angle or bearing in degrees, minutes and seconds
            double angle = 45.2413;
            
            //degrees, minutes and seconds
            double degminsec = angle;
            // decimal seconds
            double decsec = (degminsec * 100 - Math.Truncate(degminsec*100)) / .6;
            //degrees and minutes
            double degmin = (Math.Truncate(degminsec * 100) + decsec) / 100;
            //degrees
            double deg = Math.Truncate(degmin);
            //decimal degrees
            double decdeg = deg + (degmin - deg) / .6;


And this is to go back the other way:
// angle in decimal degrees
            double angle = 45.4036;
            
            //decimal degrees
            double decdeg = angle;
            //integer is minutes and the decimal is decimal seconds
            double minsec = (decdeg - Math.Truncate(decdeg)) * 60;
            //seconds
            double sec = (minsec - Math.Truncate(minsec)) * 60; 
            //degrees, miutes and seconds
            double degminsec = (Math.Truncate(sec) / 10000) + (Math.Truncate(minsec) / 100) + Math.Truncate(decdeg);

GeneralRe: Degrees, minutes and seconds to Decimal Degrees Pin
Abhinav S27-Mar-10 7:27
Abhinav S27-Mar-10 7:27 
GeneralRe: Degrees, minutes and seconds to Decimal Degrees Pin
Darrall27-Mar-10 7:35
Darrall27-Mar-10 7:35 
GeneralRe: Degrees, minutes and seconds to Decimal Degrees Pin
Tarakeshwar Reddy27-Mar-10 7:52
professionalTarakeshwar Reddy27-Mar-10 7:52 
GeneralRe: Degrees, minutes and seconds to Decimal Degrees Pin
Richard MacCutchan27-Mar-10 7:52
mveRichard MacCutchan27-Mar-10 7:52 
AnswerRe: Degrees, minutes and seconds to Decimal Degrees Pin
Tarakeshwar Reddy27-Mar-10 8:02
professionalTarakeshwar Reddy27-Mar-10 8:02 
GeneralRe: Degrees, minutes and seconds to Decimal Degrees Pin
Darrall27-Mar-10 14:51
Darrall27-Mar-10 14:51 
Questionupdate Dictionary with new KeyValuePair set Pin
igalep13227-Mar-10 4:07
igalep13227-Mar-10 4:07 
AnswerRe: update Dictionary with new KeyValuePair set[modified] Pin
Dan Mos27-Mar-10 4:35
Dan Mos27-Mar-10 4:35 
AnswerRe: update Dictionary with new KeyValuePair set Pin
Abhinav S27-Mar-10 4:47
Abhinav S27-Mar-10 4:47 
GeneralRe: update Dictionary with new KeyValuePair set Pin
Dan Mos27-Mar-10 5:07
Dan Mos27-Mar-10 5:07 
GeneralRe: update Dictionary with new KeyValuePair set Pin
igalep13227-Mar-10 5:07
igalep13227-Mar-10 5:07 
GeneralRe: update Dictionary with new KeyValuePair set Pin
Dan Mos27-Mar-10 5:32
Dan Mos27-Mar-10 5:32 
GeneralRe: update Dictionary with new KeyValuePair set Pin
igalep13227-Mar-10 5:35
igalep13227-Mar-10 5:35 
GeneralRe: update Dictionary with new KeyValuePair set Pin
Dan Mos27-Mar-10 5:42
Dan Mos27-Mar-10 5:42 
GeneralRe: update Dictionary with new KeyValuePair set Pin
igalep13227-Mar-10 5:45
igalep13227-Mar-10 5:45 
AnswerRe: update Dictionary with new KeyValuePair set Pin
Daniel Grunwald27-Mar-10 7:18
Daniel Grunwald27-Mar-10 7:18 
GeneralRe: update Dictionary with new KeyValuePair set Pin
PIEBALDconsult27-Mar-10 17:23
mvePIEBALDconsult27-Mar-10 17:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.