Skip to content

Angle class

Diagram

classDiagram class Angle { -double radians +radians() double +degrees() double +turns() double }

Summary

Language Type Symbol
C struct Angle
C++ struct dogma::Angle
Dart class Angle
Go struct dogma.Angle
Java interface dogma.Angle
JS class dogma.Angle
Protobuf message dogma.Angle
Python class dogma.Angle
Ruby class Dogma::Angle
Rust struct dogma::Angle
Zig struct dogma.Angle

Description

Angles are represented using radians, but can be constructed from radians, degrees, or turns.

Import

#include <dogma.h>  // for Angle
#include <dogma.hpp>  // for Angle

using dogma::Angle;
import 'package:dogma/dogma.dart' show Angle;
import "github.com/dogmatists/dogma.go/dogma"
import dogma.Angle;
import {Angle} from "./dogma.js";
from dogma import Angle
require 'dogma'

include Dogma::Angle
extern crate dogma;

use dogma::Angle;
const Angle = @import("dogma").Angle;

Constants

Constructor

From degrees

AngleFromDegrees(180)
Angle::from_degrees(180)
Angle.fromDegrees(180)
AngleFromDegrees(180)
Angle.fromDegrees(180)
Angle.fromDegrees(180)
Angle(degrees=180)
Angle.new(degrees: 180)
Angle::from_degrees(180)
Angle.fromDegrees(180)

From radians

AngleFromRadians(M_PI)
Angle::from_radians(M_PI)
Angle.fromRadians(math.pi)
AngleFromRadians(math.Pi)
Angle.fromRadians(Math.PI)
Angle.fromRadians(Math.PI)
Angle(radians=math.pi)
Angle.new(radians: Math::PI)
Angle::from_radians(std::f64::consts::PI)
Angle.fromRadians(std.math.pi)

From turns

AngleFromTurns(0.5)
Angle::from_turns(0.5)
Angle.fromTurns(0.5)
AngleFromTurns(0.5)
Angle.fromTurns(0.5)
Angle.fromTurns(0.5)
Angle(turns=0.5)
Angle.new(turns: 0.5)
Angle::from_turns(0.5)
Angle.fromTurns(0.5)

Properties

degrees

AngleToDegrees(angle)
angle.degrees()
angle.degrees
angle.Degrees()
angle.getDegrees()
angle.degrees
angle.degrees
angle.degrees
angle.degrees()
angle.degrees()

radians

AngleToRadians(angle)
angle.radians()
angle.radians
angle.Radians()
angle.getRadians()
angle.radians
angle.radians
angle.radians
angle.radians()
angle.radians()

turns

AngleToTurns(angle)
angle.turns()
angle.turns
angle.Turns()
angle.getTurns()
angle.turns
angle.turns
angle.turns
angle.turns()
angle.turns()

Methods

Schema

struct Angle {
  radians: double;
}
Joi.number()
{"type": "number"}
dogma:Angle
  a owl:DatatypeProperty ;
  rdfs:range xsd:double .
message Angle {
  double radians = 1;
}
angle DOUBLE PRECISION  -- in radians
<xs:simpleType name="Angle">
  <xs:restriction base="xs:double"/>
</xs:simpleType>

Serialization

0.0                 //   0° in radians
1.5707963267948966  //  90° in radians (0.5π)
3.141592653589793   // 180° in radians (π)
4.71238898038469    // 270° in radians (1.5π)
6.283185307179586   // 360° in radians (2π)
// TODO
<!-- TODO -->

FAQs

References