Ver Mensaje Individual
  #1  
Antiguo 01-06-2004
Avatar de Picard
Picard Picard is offline
Miembro
 
Registrado: may 2004
Ubicación: Palamos
Posts: 23
Reputación: 0
Picard Va por buen camino
Convertir decimales a radianes

Sabeis de algun metodo para convertir decimales a radianes? en los ejemplos de easymap vcl me lo hace asi, pero esta en pascal y no tengo ni idea de como hacerlo en c++ builder,
Código:
  
procedure TfrmMain.MapMouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
 DisplayPosition(X,Y);
end;

procedure TfrmMain.DisplayPosition(X, Y: Integer);
var
 mX, mY: Extended;
 degX, minX, secX, degY, minY, secY: Integer;
 signX, signY, sX, sY: String;
begin
 if Map.Layers.Count = 0 then Exit;
 Map.ScreenToMap(X, Y, mX, mY);
 if actPositionInDegree.Checked then
  begin
   if mx < 0 then signX := '-' else signX := '';//'+';
   mX := abs(mX);
   degX := trunc(int(mX));
   minX := trunc(int((mX-degX)* 60));
   secX := trunc(int((mX-degX-minX/60)*3600));
   sX := Format('%S%-.3D-%.2D''%.2D"', [signX, degX, minX, secX]);

   if mY < 0 then signY := '-' else signY := '';//'+';
   mY := abs(mY);
   degY := trunc(int(mY));
   minY := trunc(int((mY-degY)* 60));
   secY := trunc(int((mY-degY-minY/60)*3600));
   sY := Format('%S%-.3D-%.2D''%.2D"', [signY, degY, minY, secY]);
  end
 else
  begin
   sX := Format('%F', [mX]);
   sY := Format('%F', [mY]);
  end;
 StatusBar.Panels[1].Text := Format('X=%S Y=%S', [sX, sY]);
end;
gracias
Responder Con Cita