/* * Copyright (c) 1995, 1996 Gunther Schadow. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef PG_BASEUNIT_H_ #define PG_BASEUNIT_H_ #include #include #pragma interface /*--------------------------------------------------------------------------- THE VECTOR OF BASIC MEASURES This file defines the struct base_unit_vector. The base unit vector tries to enclose any mesured phenomena and thereby tries to be minimal. The elements of the base unit vector are interger numbers which denote the exponent under which the corresponding basic measure counts to the derived measure. Consider a simple base vector [L, T] that is made up only of length (L) and time (T), at least the following measures can be expressed: Measure Vector ------------- ------- 1 [ 0, 0] length [ 1, 0] area [ 2, 0] volume [ 3, 0] time [ 0, 1] velocity [ 1,-1] acceleration [ 1,-2] fluid current [ 3,-1] ... ... The operations on these classes of vectors are: Addition and subtraction, which means multiplication resp. division of measures; and multiplication of a vector with a scalar (integer) n which means the n-th potence of the measure. The example below shows the calculation of the acceleration vector: acceleration = length / time ^ 2 = [ 1, 0] - [ 0, 1] * 2 = [ 1, 0] - [ 0, 2] = [ 1,-2] Minimality is the reason why the concept of SI base units had to be left almost completely. SI base units are the following: Measure Unit ----------------------------- ------- ----------- length m meter mass kg kilogram time s second electric current A Amp`ere thermodynamic temperature K Kelvin amount of substance mol mole luminous intensity cd candela While there are no problems with length, time and temperature, it is certainly not useful to have a prefix `kilo' in a base unit as it is the case with mass. The reason for this is consistency with the rules of prefixing: If we would accept kg as a base unit, we had to allow 1kkg = 1Mg and 1mkg = 1g which is certainly not correct. Thus I decided to use the Gram as the base unit for mass. It might be just for my personal taste that I use the charge as the base unit of electrical phenomena instead of currency: it is the electron resp. the elementary *charge* that all electical phenomena are based on. Since the amount of substance represents just the number of particles, it is in fact a dimensionless measure (see The Feynman Lecutres on Physics p.39-10??). The mole will therefore be defined later as a pseudo-unit equal to avogadro's number. Finally, I am not yet finished with luminous intensity and I am thinking about dropping it as a base unit. Since the luminous phenomenon is either just another electromagnetic phenomenon or it belongs into the sensory physiology just like the intensity of sound. Since I'm not yet aware of the implications of the candela as a base unit, I'll leave it untouched for the time being. The following table shows the basic measures as I will use them here: Measure Unit ----------------------------- ------- ----------- length m meter time s second mass g gram electrical charge C Coulomb termodynamic temperature K Kelvin luminous intensity cd candela angle circ Circle As can be seen, I admitted the angle to the list of basic measures. Otherwise I see no way how to be aware of the incommensurability of steradian and radian (1sr = rad^2). The angle is measured in whole circles, thus 360deg = 1circ is true. By this way, there is something that can be considered as a law of nature that describes relation of radius (r), length of the bow (b) and angle (phi): b[m] = P[1/circ] * phi[circ] * r[m] with the constant P: (2pi)m P = ---------- = (2pi)/circ 1circ / 1m ---------------------------------------------------------------------------*/ struct base_unit_vector { int length :8; // Length in 1m (Meter) int time :8; // Time in 1s (Second) int mass :8; // Mass in 1g (Gram) int charge :8; // Electrical charge in 1C (Coulomb) int temperature :8; // Thermodynamic temperature in 1K (Kelvin) int lumin_intens :8; // Luminous intensity in 1cd (Candela) int angle :8; // Angle in 1circ (Circle) base_unit_vector operator + (const base_unit_vector&) const; base_unit_vector operator - (const base_unit_vector&) const; base_unit_vector operator - () const; base_unit_vector& operator += (const base_unit_vector&); base_unit_vector& operator -= (const base_unit_vector&); base_unit_vector operator * (int x) const; base_unit_vector& operator *= (int x); bool operator == (const base_unit_vector&) const; bool operator != (const base_unit_vector&) const; ostream& show(ostream &) const; }; #ifndef OUTLINE # include "BaseUnit.icc" #endif #endif /* !PG_BASEUNIT_H_ */