• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kstars

Public Member Functions | List of all members
dms Class Reference

#include <dms.h>

Public Member Functions

 dms ()
 
 dms (const int &d, const int &m=0, const int &s=0, const int &ms=0)
 
 dms (const double &x)
 
 dms (const QString &s, bool isDeg=true)
 
int arcmin () const
 
int arcsec () const
 
int degree () const
 
const double & Degrees () const
 
int hour () const
 
double Hours () const
 
int marcsec () const
 
int minute () const
 
int msecond () const
 
int second () const
 
void setD (const double &x)
 

Detailed Description

An angle, stored as degrees, but expressible in many ways.

Author
Jason Harris
Version
1.0

dms encapsulates an angle. The angle is stored as a double, equal to the value of the angle in degrees. Methods are available for setting/getting the angle as a floating-point measured in Degrees or Hours, or as integer triplets (degrees, arcminutes, arcseconds or hours, minutes, seconds). There is also a method to set the angle according to a radian value, and to return the angle expressed in radians. Finally, a SinCos() method computes the sin and cosine of the angle.

Definition at line 42 of file dms.h.

Constructor & Destructor Documentation

dms::dms ( )
inline

Default constructor.

Definition at line 45 of file dms.h.

dms::dms ( const int &  d,
const int &  m = 0,
const int &  s = 0,
const int &  ms = 0 
)
inlineexplicit

Set the floating-point value of the angle according to the four integer arguments.

Parameters
ddegree portion of angle (int). Defaults to zero.
marcminute portion of angle (int). Defaults to zero.
sarcsecond portion of angle (int). Defaults to zero.
msarcsecond portion of angle (int). Defaults to zero.

Definition at line 53 of file dms.h.

dms::dms ( const double &  x)
inlineexplicit

Construct an angle from a double value.

Creates an angle whose value in Degrees is equal to the argument.

Parameters
xangle expressed as a floating-point number (in degrees)

Definition at line 60 of file dms.h.

dms::dms ( const QString &  s,
bool  isDeg = true 
)
inlineexplicit

Construct an angle from a string representation.

Attempt to create the angle according to the string argument. If the string cannot be parsed as an angle value, the angle is set to zero.

Warning
There is not an unambiguous notification that it failed to parse the string, since the string could have been a valid representation of zero degrees. If this is a concern, use the setFromString() function directly instead.
Parameters
sthe string to parse as a dms value.
isDegif true, value is in degrees; if false, value is in hours.
See also
setFromString()

Definition at line 75 of file dms.h.

Member Function Documentation

int dms::arcmin ( void  ) const
Returns
integer arcminutes portion of the angle.
Note
an arcminute is 1/60 degree.

Definition at line 148 of file dms.cpp.

int dms::arcsec ( void  ) const
Returns
integer arcseconds portion of the angle
Note
an arcsecond is 1/60 arcmin, or 1/3600 degree.

Definition at line 156 of file dms.cpp.

int dms::degree ( ) const
inline
Returns
integer degrees portion of the angle

Definition at line 79 of file dms.h.

const double& dms::Degrees ( ) const
inline
Returns
angle in degrees expressed as a double.

Definition at line 98 of file dms.h.

int dms::hour ( ) const
inline
Returns
integer hours portion of the angle
Note
an angle can be measured in degrees/arcminutes/arcseconds or hours/minutes/seconds. An hour is equal to 15 degrees.

Definition at line 104 of file dms.h.

double dms::Hours ( ) const
inline
Returns
angle in hours expressed as a double.
Note
an angle can be measured in degrees/arcminutes/arcseconds or hours/minutes/seconds. An hour is equal to 15 degrees.

Definition at line 125 of file dms.h.

int dms::marcsec ( void  ) const
Returns
integer milliarcseconds portion of the angle
Note
a milliarcsecond is 1/1000 arcsecond.

Definition at line 165 of file dms.cpp.

int dms::minute ( void  ) const
Returns
integer minutes portion of the angle
Note
a minute is 1/60 hour (not the same as an arcminute)

Definition at line 174 of file dms.cpp.

int dms::msecond ( void  ) const
Returns
integer milliseconds portion of the angle
Note
a millisecond is 1/1000 second (not the same as a milliarcsecond)

Definition at line 190 of file dms.cpp.

int dms::second ( void  ) const
Returns
integer seconds portion of the angle
Note
a second is 1/3600 hour (not the same as an arcsecond)

Definition at line 182 of file dms.cpp.

void dms::setD ( const double &  x)
inline

Sets floating-point value of angle, in degrees.

Parameters
xnew angle (double)

Definition at line 130 of file dms.h.


The documentation for this class was generated from the following files:
  • dms.h
  • dms.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:22 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kstars

Skip menu "kstars"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal