HP Forums

Full Version: Deg Min Sec question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How do you assign an angle in degrees, minutes, seconds to a variable?

Code:
LOCAL aa,bb;
EXPORT AngleCalcs()
BEGIN
  aa:=EXPR("25°15'00"");
  bb:=aa + EXPR("7°12'13"");
  PRINT();
  PRINT("aa="+aa);
  PRINT("bb="+bb);
END;
I think you don't have the correct unicode characters for min and sec. Try with: 25°15′00″ and 7°12′13″ (they may look the same as your's in the browser but they are not the same.
I was wondering, what are tr (turn 360 degrees) angle units?

Code:
LOCAL aa,bb,cc,dd;
EXPORT AngleCalcsExamples()
BEGIN

  //DMS calcs

  aa:=EXPR("25°15′5″");
  bb:=aa + EXPR("7°12′13.57″");
  PRINT();
  PRINT("aa (DMS)="+aa);
  PRINT("bb="+bb);

  //conversion from DMS to DEG, and vice versa

  cc:=45.75;
  PRINT("cc-deg="+cc);
  cc:=→HMS(cc);
  PRINT("cc-dms="+cc);
  cc:=HMS→(cc);
  PRINT("cc-deg="+cc);

  //tr angle calcs???

  dd:=SIN(325°15′55.3″);
  PRINT("SIN(325°15′55.3″)="+dd);

  dd:=SIN(325.2525_tr);
  PRINT("SIN(325.2525_tr″)="+dd);
  dd:=COS(45_tr);
  PRINT("COS(45_tr)="+dd);

END;
Hello,

The tr, deg, rad... units are.. well units.
They are units in the fact that they are treated like unit objects, can be converted from one to another.

As a "hack", they are also supported in trig functions.

But their use is relatively limited in reality.

Cyrille
Reference URL's