Trax3 3.1.0
trax track library
Loading...
Searching...
No Matches
Units.h
1// trax track library
2// AD 2014
3//
4// "She asked you if you love her
5// and you nod and say: Uh-Huh"
6//
7// Jade Bird
8//
9// Copyright (c) 2025 Trend Redaktions- und Verlagsgesellschaft mbH
10// Copyright (c) 2019 Marc-Michael Horstmann
11//
12// Permission is hereby granted to any person obtaining a copy of this software
13// and associated source code (the "Software"), to use, view, and study the
14// Software for personal or internal business purposes, subject to the following
15// conditions:
16//
17// 1. Redistribution, modification, sublicensing, or commercial use of the
18// Software is NOT permitted without prior written consent from the copyright
19// holder.
20//
21// 2. The Software is provided "AS IS", without warranty of any kind, express
22// or implied.
23//
24// 3. All copies of the Software must retain this license notice.
25//
26// For further information, please contact: horstmann.marc@trendverlag.de
27
28#pragma once
29
105
106#include "dim/DimensionedValues.h"
107#include "dim/DimLimits.h"
108
109#include "spat/Vector.h"
110
111namespace trax {
112
113 using namespace dim;
114
115
117 constexpr Time attention_span = 3_s;
118
119 constexpr Velocity maximum__velocity = 500_kmIh;
120
122 constexpr Acceleration g{-9.81f * units_per_meter};
123
124 constexpr Velocity bolt = 100_m / 9.58_s;
125
129
130 constexpr Length earth_radius = 6.371e6_m;
131
132 // \brief Fixed simulation steps per second.
133 constexpr Real steps_per_second = 60;
134
136 constexpr Time fixed_timestep = 1_s / steps_per_second;
137
144 constexpr spat::Vector<One> Up = spat::Ez<One>;
145
146 constexpr spat::Vector<Acceleration> G = g * Up;
147
149 constexpr AnglePerLength epsilon__curvature = 1 / earth_radius;
150} // namespace trax
constexpr Real _s(Time t) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1535
Value< Dimension< 1, 0, -1 > > Velocity
Velocity.
Definition DimensionedValues.h:331
Value< Dimension< 1, 0, 0 > > Length
Length.
Definition DimensionedValues.h:324
Value< Dimension< 0, 0, 1 > > Time
Time.
Definition DimensionedValues.h:329
constexpr Real _kmIh(Velocity v) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1403
constexpr Real _m(Length l) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1210
Value< Dimension< 1, 0, -2 > > Acceleration
Acceleration.
Definition DimensionedValues.h:332
Value< Dimension<-1, 0, 0 > > AnglePerLength
Angle per length.
Definition DimensionedValues.h:321
constexpr Real units_per_meter
How many units will make up one meter.
Definition DimensionedValues.h:207
float Real
Underlying floating point type to be used with the dim library.
Definition DimensionedValues.h:190
Namespace of all the trax track libraries classes and methods.
Definition Collection.h:17
constexpr Time fixed_timestep
The fixed timestep to use with the simulation.
Definition Units.h:136
constexpr Acceleration g
Acceleration due to gravity.
Definition Units.h:122
constexpr Time attention_span
The maximum time, a user is expected to concentrate on one single apect of the simulation.
Definition Units.h:117
constexpr spat::Vector< One > Up
Vector pointing in the up direction with respect to gravity.
Definition Units.h:144
constexpr AnglePerLength epsilon__curvature
Marginal curvature is earth's curvature.
Definition Units.h:149
constexpr Velocity bolt
fastest man in the world
Definition Units.h:124
constexpr Length default_derailing_distance
A default value for the acceptable distance between a track position and something beeing still consi...
Definition Units.h:128
Implements a 3D - vector in cartesian coordinates.
Definition Vector.h:48