// To run this, type: // cargo run --example full mod units; use rs_measures::{angle::Radian, traits::CrossProduct}; use units::*; fn print_all_acceleration_units() { println!("* Acceleration units"); println!( " MetrePerSquareSecond: {}, {}, {}, {}, {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), Measure2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.), Measure3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.), ); println!( " GForce: {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), Measure2d::::new(1., 2.), Measure2d::::new(1., 2.).convert::(), MeasurePoint2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.).convert::(), Measure3d::::new(1., 2., 3.), Measure3d::::new(1., 2., 3.).convert::(), MeasurePoint3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.).convert::(), ); println!( " KiloMetrePerHourPerSecond: {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), Measure2d::::new(1., 2.), Measure2d::::new(1., 2.).convert::(), MeasurePoint2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.).convert::(), Measure3d::::new(1., 2., 3.), Measure3d::::new(1., 2., 3.).convert::(), MeasurePoint3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.) .convert::(), ); println!(); } fn print_all_action_units() { println!("* Action units"); println!( " JouleSecond: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!(); } fn print_all_amount_units() { println!("* Amount units"); println!( " Unit: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!( " Dozen: {}, {}, {}, {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " Mole: {}, {}, {}, {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!(); } fn print_all_angle_units() { println!("** Angle units **"); println!( " Radian: {}, {}, {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), SignedDirection::::new(1.), UnsignedDirection::::new(1.), ); println!( " Cycle: {} == {}, {} == {}, {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), SignedDirection::::new(1.), SignedDirection::::new(1.).convert::(), UnsignedDirection::::new(1.), UnsignedDirection::::new(1.).convert::(), ); println!( " Gradian: {} == {}, {} == {}, {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), SignedDirection::::new(1.), SignedDirection::::new(1.).convert::(), UnsignedDirection::::new(1.), UnsignedDirection::::new(1.).convert::(), ); println!( " Degree: {} == {}, {} == {}, {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), SignedDirection::::new(1.), SignedDirection::::new(1.).convert::(), UnsignedDirection::::new(1.), UnsignedDirection::::new(1.).convert::(), ); println!( " ArcMinute: {} == {}, {} == {}, {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), SignedDirection::::new(1.), SignedDirection::::new(1.).convert::(), UnsignedDirection::::new(1.), UnsignedDirection::::new(1.).convert::(), ); println!( " ArcSecond: {} == {}, {} == {}, {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), SignedDirection::::new(1.), SignedDirection::::new(1.).convert::(), UnsignedDirection::::new(1.), UnsignedDirection::::new(1.).convert::(), ); println!(); } fn print_all_angular_acceleration_units() { println!("* AngularAcceleration units"); println!( " RadianPerSquareSecond: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!(); } fn print_all_angular_momentum_units() { println!("* AngularMomentum units"); println!( " KiloGramSquareMetrePerSecond: {}, {}, {}, {}, {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), Measure2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.), Measure3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.), ); println!( " GramSquareCentiMetrePerSecond: {} == {}, {} == {}, {} == {}, {} == {}, {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), Measure2d::::new(1., 2.), Measure2d::::new(1., 2.).convert::(), MeasurePoint2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.).convert::(), Measure3d::::new(1., 2., 3.), Measure3d::::new(1., 2., 3.).convert::(), MeasurePoint3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.).convert::(), ); println!(); } fn print_all_area_units() { println!("* Area units"); println!( " SquareMetre: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.) ); println!( " SquareKiloMetre: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " Hectare: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " Are: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " SquareDeciMetre: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " SquareCentiMetre: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " SquareMilliMetre: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " SquareInch: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " SquareFoot: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " SquareYard: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " SquareMile: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!(); } fn print_all_area_density_units() { println!("* AreaDensity units"); println!( " KiloGramPerSquareMetre: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!(); } fn print_all_capacitance_units() { println!("* Capacitance units"); println!( " Farad: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!( " MilliFarad: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " MicroFarad: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " NanoFarad: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " PicoFarad: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!(); } fn print_all_catalytic_activity_units() { println!("* CatalyticActivity units"); println!( " Katal: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!(); } fn print_all_chemical_potential_units() { println!("* ChemicalPotential units"); println!( " JoulePerMole: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!(); } fn print_all_current_density_units() { println!("* CurrentDensity units"); println!( " AmperePerSquareMetre: {}, {}, {}, {}, {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), Measure2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.), Measure3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.), ); println!(); } fn print_all_dimensionless_units() { println!("* Dimensionless units"); println!( " Unspecified: {}, {}, {}, {}, {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), Measure2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.), Measure3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.) ); println!( " Mach: {} == {}, {} == {}, {} == {}, {} == {}, {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), Measure2d::::new(1., 2.), Measure2d::::new(1., 2.).convert::(), MeasurePoint2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.).convert::(), Measure3d::::new(1., 2., 3.), Measure3d::::new(1., 2., 3.).convert::(), MeasurePoint3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.).convert::(), ); println!(); } fn print_all_dose_equivalent_units() { println!("* DoseEquivalent units"); println!( " Sievert: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!( " Rem: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!(); } fn print_all_dynamic_viscosity_units() { println!("* DynamicViscosity units"); println!( " PascalSecond: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!(); } fn print_all_electrical_conductance_units() { println!("* ElectricalConductance units"); println!( " Siemens: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!(); } fn print_all_electrical_conductivity_units() { println!("* ElectricalConductivity units"); println!( " SiemensPerMetre: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!(); } fn print_all_electrical_resistance_units() { println!("* ElectricalResistance units"); println!( " Ohm: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!( " MilliOhm: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " KiloOhm: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!(); } fn print_all_electrical_resistivity_units() { println!("* ElectricalResistivity units"); println!( " OhmMetre: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!(); } fn print_all_electric_charge_units() { println!("* ElectricCharge units"); println!( " Coulomb: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!( " MilliCoulomb: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " MicroCoulomb: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " NanoCoulomb: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " PicoCoulomb: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!(); } fn print_all_electric_charge_density_units() { println!("* ElectricChargeDensity units"); println!( " CoulombPerCubicMetre: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!(); } fn print_all_electric_current_units() { println!("* ElectricCurrent units"); println!( " Ampere: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!( " MilliAmpere: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " MicroAmpere: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!(); } fn print_all_electric_displacement_units() { println!("* ElectricDisplacement units"); println!( " CoulombPerSquareMetre: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!(); } fn print_all_electric_field_strength_units() { println!("* ElectricFieldStrength units"); println!( " VoltPerMetre: {}, {}, {}, {}, {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), Measure2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.), Measure3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.), ); println!(); } fn print_all_electric_potential_units() { println!("* ElectricPotential units"); println!( " Volt: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!( " KiloVolt: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " MilliVolt: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " MicroVolt: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!(); } fn print_all_energy_units() { println!("* Energy units"); println!( " Joule: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!( " WattHour: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " KiloWattHour: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " MegaWattHour: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " Calorie: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " KiloCalorie: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " ElectronVolt: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " KiloElectronVolt: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " MegaElectronVolt: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " GigaElectronVolt: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " TeraElectronVolt: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!(); } fn print_all_energy_density_units() { println!("* EnergyDensity units"); println!( " JoulePerCubicMetre: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!(); } fn print_all_entropy_units() { println!("* Entropy units"); println!( " JoulePerKelvin: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!(); } fn print_all_force_units() { println!("* Force units"); println!( " Newton: {}, {}, {}, {}, {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), Measure2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.), Measure3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.), ); println!( " Dyne: {} == {}, {} == {}, {} == {}, {} == {}, {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), Measure2d::::new(1., 2.), Measure2d::::new(1., 2.).convert::(), MeasurePoint2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.).convert::(), Measure3d::::new(1., 2., 3.), Measure3d::::new(1., 2., 3.).convert::(), MeasurePoint3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.).convert::(), ); println!( " KiloGramForce: {} == {}, {} == {}, {} == {}, {} == {}, {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), Measure2d::::new(1., 2.), Measure2d::::new(1., 2.).convert::(), MeasurePoint2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.).convert::(), Measure3d::::new(1., 2., 3.), Measure3d::::new(1., 2., 3.).convert::(), MeasurePoint3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.).convert::(), ); println!( " PoundForce: {} == {}, {} == {}, {} == {}, {} == {}, {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), Measure2d::::new(1., 2.), Measure2d::::new(1., 2.).convert::(), MeasurePoint2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.).convert::(), Measure3d::::new(1., 2., 3.), Measure3d::::new(1., 2., 3.).convert::(), MeasurePoint3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.).convert::(), ); println!( " Poundal: {} == {}, {} == {}, {} == {}, {} == {}, {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), Measure2d::::new(1., 2.), Measure2d::::new(1., 2.).convert::(), MeasurePoint2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.).convert::(), Measure3d::::new(1., 2., 3.), Measure3d::::new(1., 2., 3.).convert::(), MeasurePoint3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.).convert::(), ); println!(); } fn print_all_frequency_units() { println!("* All Frequency units"); println!( " Hertz: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!( " KiloHertz: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " MegaHertz: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " GigaHertz: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " RadianPerSecond: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " CyclePerMinute: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!(); } fn print_all_illuminance_units() { println!("* Illuminance units"); println!( " Lux: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!( " Phot: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " FootCandle: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!(); } fn print_all_inductance_units() { println!("* Inductance units"); println!( " Henry: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!(); } fn print_all_information_units() { println!("* Information units"); println!( " Bit: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!( " Byte: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " KiloBit: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " KiloByte: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " KibiBit: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " KibiByte: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " MegaBit: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " MegaByte: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " MebiBit: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " MebiByte: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " GigaBit: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " GigaByte: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " GibiBit: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " GibiByte: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " TeraBit: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " TeraByte: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " TebiBit: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " TebiByte: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!(); } fn print_all_information_rate_units() { println!("* InformationRate units"); println!( " BitPerSecond: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!( " BytePerSecond: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " KiloBitPerSecond: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " KiloBytePerSecond: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " KibiBitPerSecond: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " KibiBytePerSecond: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " MegaBitPerSecond: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " MegaBytePerSecond: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " MebiBitPerSecond: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " MebiBytePerSecond: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " GigaBitPerSecond: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " GigaBytePerSecond: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " GibiBitPerSecond: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " GibiBytePerSecond: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " TeraBitPerSecond: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " TeraBytePerSecond: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " TebiBitPerSecond: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " TebiBytePerSecond: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!(); } fn print_all_irradiance_units() { println!("* Irradiance units"); println!( " WattPerSquareMetre: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!(); } fn print_all_kinematic_viscosity_units() { println!("* KinematicViscosity units"); println!( " SquareMetrePerSecond: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!( " Stoke: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " CentiStoke: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!(); } fn print_all_length_units() { println!("* Length units"); println!( " Metre: {}, {}, {}, {}, {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), Measure2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.), Measure3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.), ); println!( " AstronomicalUnit: {} == {}, {} == {}, {} == {}, {} == {}, {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), Measure2d::::new(1., 2.), Measure2d::::new(1., 2.).convert::(), MeasurePoint2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.).convert::(), Measure3d::::new(1., 2., 3.), Measure3d::::new(1., 2., 3.).convert::(), MeasurePoint3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.).convert::(), ); println!( " Parsec: {} == {}, {} == {}, {} == {}, {} == {}, {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), Measure2d::::new(1., 2.), Measure2d::::new(1., 2.).convert::(), MeasurePoint2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.).convert::(), Measure3d::::new(1., 2., 3.), Measure3d::::new(1., 2., 3.).convert::(), MeasurePoint3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.).convert::(), ); println!( " LightYear: {} == {}, {} == {}, {} == {}, {} == {}, {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), Measure2d::::new(1., 2.), Measure2d::::new(1., 2.).convert::(), MeasurePoint2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.).convert::(), Measure3d::::new(1., 2., 3.), Measure3d::::new(1., 2., 3.).convert::(), MeasurePoint3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.).convert::(), ); println!( " KiloMetre: {} == {}, {} == {}, {} == {}, {} == {}, {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), Measure2d::::new(1., 2.), Measure2d::::new(1., 2.).convert::(), MeasurePoint2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.).convert::(), Measure3d::::new(1., 2., 3.), Measure3d::::new(1., 2., 3.).convert::(), MeasurePoint3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.).convert::(), ); println!( " HectoMetre: {} == {}, {} == {}, {} == {}, {} == {}, {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), Measure2d::::new(1., 2.), Measure2d::::new(1., 2.).convert::(), MeasurePoint2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.).convert::(), Measure3d::::new(1., 2., 3.), Measure3d::::new(1., 2., 3.).convert::(), MeasurePoint3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.).convert::(), ); println!( " DecaMetre: {} == {}, {} == {}, {} == {}, {} == {}, {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), Measure2d::::new(1., 2.), Measure2d::::new(1., 2.).convert::(), MeasurePoint2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.).convert::(), Measure3d::::new(1., 2., 3.), Measure3d::::new(1., 2., 3.).convert::(), MeasurePoint3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.).convert::(), ); println!( " DeciMetre: {} == {}, {} == {}, {} == {}, {} == {}, {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), Measure2d::::new(1., 2.), Measure2d::::new(1., 2.).convert::(), MeasurePoint2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.).convert::(), Measure3d::::new(1., 2., 3.), Measure3d::::new(1., 2., 3.).convert::(), MeasurePoint3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.).convert::(), ); println!( " CentiMetre: {} == {}, {} == {}, {} == {}, {} == {}, {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), Measure2d::::new(1., 2.), Measure2d::::new(1., 2.).convert::(), MeasurePoint2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.).convert::(), Measure3d::::new(1., 2., 3.), Measure3d::::new(1., 2., 3.).convert::(), MeasurePoint3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.).convert::(), ); println!( " MilliMetre: {} == {}, {} == {}, {} == {}, {} == {}, {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), Measure2d::::new(1., 2.), Measure2d::::new(1., 2.).convert::(), MeasurePoint2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.).convert::(), Measure3d::::new(1., 2., 3.), Measure3d::::new(1., 2., 3.).convert::(), MeasurePoint3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.).convert::(), ); println!( " MicroMetre: {} == {}, {} == {}, {} == {}, {} == {}, {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), Measure2d::::new(1., 2.), Measure2d::::new(1., 2.).convert::(), MeasurePoint2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.).convert::(), Measure3d::::new(1., 2., 3.), Measure3d::::new(1., 2., 3.).convert::(), MeasurePoint3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.).convert::(), ); println!( " NanoMetre: {} == {}, {} == {}, {} == {}, {} == {}, {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), Measure2d::::new(1., 2.), Measure2d::::new(1., 2.).convert::(), MeasurePoint2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.).convert::(), Measure3d::::new(1., 2., 3.), Measure3d::::new(1., 2., 3.).convert::(), MeasurePoint3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.).convert::(), ); println!( " Angstrom: {} == {}, {} == {}, {} == {}, {} == {}, {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), Measure2d::::new(1., 2.), Measure2d::::new(1., 2.).convert::(), MeasurePoint2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.).convert::(), Measure3d::::new(1., 2., 3.), Measure3d::::new(1., 2., 3.).convert::(), MeasurePoint3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.).convert::(), ); println!( " Inch: {} == {}, {} == {}, {} == {}, {} == {}, {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), Measure2d::::new(1., 2.), Measure2d::::new(1., 2.).convert::(), MeasurePoint2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.).convert::(), Measure3d::::new(1., 2., 3.), Measure3d::::new(1., 2., 3.).convert::(), MeasurePoint3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.).convert::(), ); println!( " Foot: {} == {}, {} == {}, {} == {}, {} == {}, {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), Measure2d::::new(1., 2.), Measure2d::::new(1., 2.).convert::(), MeasurePoint2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.).convert::(), Measure3d::::new(1., 2., 3.), Measure3d::::new(1., 2., 3.).convert::(), MeasurePoint3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.).convert::(), ); println!( " Yard: {} == {}, {} == {}, {} == {}, {} == {}, {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), Measure2d::::new(1., 2.), Measure2d::::new(1., 2.).convert::(), MeasurePoint2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.).convert::(), Measure3d::::new(1., 2., 3.), Measure3d::::new(1., 2., 3.).convert::(), MeasurePoint3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.).convert::(), ); println!( " Mile: {} == {}, {} == {}, {} == {}, {} == {}, {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), Measure2d::::new(1., 2.), Measure2d::::new(1., 2.).convert::(), MeasurePoint2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.).convert::(), Measure3d::::new(1., 2., 3.), Measure3d::::new(1., 2., 3.).convert::(), MeasurePoint3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.).convert::(), ); println!( " NauticalMile: {} == {}, {} == {}, {} == {}, {} == {}, {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), Measure2d::::new(1., 2.), Measure2d::::new(1., 2.).convert::(), MeasurePoint2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.).convert::(), Measure3d::::new(1., 2., 3.), Measure3d::::new(1., 2., 3.).convert::(), MeasurePoint3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.).convert::(), ); println!(); } fn print_all_linear_density_units() { println!("* LinearDensity units"); println!( " KiloGramPerMetre: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!(); } fn print_all_linear_electric_charge_density_units() { println!("* LinearElectricChargeDensity units"); println!( " CoulombPerMetre: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!(); } fn print_all_luminance_units() { println!("* Luminance units"); println!( " CandelaPerSquareMetre: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!( " Stilb: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!(); } fn print_all_luminous_flux_units() { println!("* LuminousFlux units"); println!( " Lumen: {}, {}, {}, {}, {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), Measure2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.), Measure3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.), ); println!(); } fn print_all_luminous_intensity_units() { println!("* LuminousIntensity units"); println!( " Candela: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!(); } fn print_all_magnetic_field_strength_units() { println!("* MagneticFieldStrength units"); println!( " AmperePerMetre: {}, {}, {}, {}, {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), Measure2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.), Measure3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.), ); println!(); } fn print_all_magnetic_flux_units() { println!("* MagneticFlux units"); println!( " Weber: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!(); } fn print_all_magnetic_flux_density_units() { println!("* MagneticFluxDensity units"); println!( " Tesla: {}, {}, {}, {}, {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), Measure2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.), Measure3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.), ); println!( " Gauss: {} == {}, {} == {}, {} == {}, {} == {}, {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), Measure2d::::new(1., 2.), Measure2d::::new(1., 2.).convert::(), MeasurePoint2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.).convert::(), Measure3d::::new(1., 2., 3.), Measure3d::::new(1., 2., 3.).convert::(), MeasurePoint3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.).convert::(), ); println!(); } fn print_all_magnetic_permeability_units() { println!("* MagneticPermeability units"); println!( " HenryPerMetre: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!(); } fn print_all_magnetic_reluctance_units() { println!("* MagneticReluctance units"); println!( " InverseHenry: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!(); } fn print_all_mass_units() { println!("* Mass units"); println!( " KiloGram: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!( " Tonne: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " MetricTon: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " HectoGram: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " DecaGram: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " Gram: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " MilliGram: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " MicroGram: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " NanoGram: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " ImperialTon: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " LongTon: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " USTon: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " ShortTon: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " Stone: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " Pound: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " Ounce: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " Carat: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!(); } fn print_all_mass_density_units() { println!("* MassDensity units"); println!( " KiloGramPerCubicMetre: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!(); } fn print_all_mass_flow_rate_units() { println!("* MassFlowRate units"); println!( " KiloGramPerSecond: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!( " GramPerSecond: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!(); } fn print_all_molar_concentration_units() { println!("* MolarConcentration units"); println!( " MolePerCubicMetre: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!(); } fn print_all_molar_heat_capacity_units() { println!("* MolarHeatCapacity units"); println!( " JoulePerKelvinPerMole: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!(); } fn print_all_moment_of_inertia_units() { println!("* MomentOfInertia units"); println!( " KiloGramSquareMetre: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!( " GramSquareCentiMetre: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!(); } fn print_all_momentum_units() { println!("* Momentum units"); println!( " NewtonSecond: {}, {}, {}, {}, {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), Measure2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.), Measure3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.), ); println!( " KiloGramMetrePerSecond: {} == {}, {} == {}, {} == {}, {} == {}, {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), Measure2d::::new(1., 2.), Measure2d::::new(1., 2.).convert::(), MeasurePoint2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.).convert::(), Measure3d::::new(1., 2., 3.), Measure3d::::new(1., 2., 3.).convert::(), MeasurePoint3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.).convert::(), ); println!( " DynSecond: {} == {}, {} == {}, {} == {}, {} == {}, {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), Measure2d::::new(1., 2.), Measure2d::::new(1., 2.).convert::(), MeasurePoint2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.).convert::(), Measure3d::::new(1., 2., 3.), Measure3d::::new(1., 2., 3.).convert::(), MeasurePoint3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.).convert::(), ); println!( " GramCentiMetrePerSecond: {} == {}, {} == {}, {} == {}, {} == {}, {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), Measure2d::::new(1., 2.), Measure2d::::new(1., 2.).convert::(), MeasurePoint2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.).convert::(), Measure3d::::new(1., 2., 3.), Measure3d::::new(1., 2., 3.).convert::(), MeasurePoint3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.).convert::(), ); println!(); } fn print_all_permittivity_units() { println!("* Permittivity units"); println!( " FaradPerMetre: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!(); } fn print_all_power_units() { println!("* Power units"); println!( " Watt: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!( " MilliWatt: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " KiloWatt: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " MegaWatt: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " GigaWatt: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " HorsePower: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!(); } fn print_all_pressure_units() { println!("* Pressure units"); println!( " Pascal: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!( " HectoPascal: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " Atmosphere: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " Bar: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " MilliBar: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " MmHg: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " PoundForcePerSquareInch: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!(); } fn print_all_radiance_units() { println!("* Radiance units"); println!( " WattPerSquareMetrePerSteradian: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!(); } fn print_all_radiant_intensity_units() { println!("* RadiantIntensity units"); println!( " WattPerSteradian: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!(); } fn print_all_radioactive_activity_units() { println!("* RadioactiveActivity units"); println!( " Becquerel: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!( " KiloBecquerel: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " MegaBecquerel: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " GigaBecquerel: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!(); } fn print_all_radioactive_dose_units() { println!("* RadioactiveDose units"); println!( " Gray: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!( " Rad: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!(); } fn print_all_radioactive_dose_rate_units() { println!("* RadioactiveDoseRate units"); println!( " GrayPerSecond: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!(); } fn print_all_reaction_rate_units() { println!("* ReactionRate units"); println!( " MolePerCubicMetrePerSecond: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!(); } fn print_all_solid_angle_units() { println!("* SolidAngle units"); println!( " Steradian: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!( " Spat: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " SquareDegree: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!(); } fn print_all_specific_energy_units() { println!("* SpecificEnergy units"); println!( " JoulePerKiloGram: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!(); } fn print_all_specific_heat_capacity_units() { println!("* SpecificHeatCapacity units"); println!( " JoulePerKiloGramPerKelvin: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!(); } fn print_all_specific_volume_units() { println!("* SpecificVolume units"); println!( " CubicMetrePerKiloGram: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!(); } fn print_all_square_time_units() { println!("* SquareTime units"); println!( " SquareSecond: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!( " HourSecond: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " HourHour: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!(); } fn print_all_surface_density_units() { println!("* SurfaceDensity units"); println!( " KiloGramPerSquareMetre: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!(); } fn print_all_surface_tension_units() { println!("* SurfaceTension units"); println!( " JoulePerSquareMetre: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!(); } fn print_all_temperature_units() { println!("* Temperature units"); println!( " Kelvin: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!( " Celsius: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " Fahrenheit: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!(); } fn print_all_thermal_conductivity_units() { println!("* ThermalConductivity units"); println!( " WattPerMetrePerKelvin: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!(); } fn print_all_time_units() { println!("* Time units"); println!( " Second: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!( " Year: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " Month: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " Week: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " Day: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " Hour: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " Minute: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " MilliSecond: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " MicroSecond: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " NanoSecond: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " PicoSecond: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " FemtoSecond: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!(); } fn print_all_torque_units() { println!("* Torque units"); println!( " NewtonMetre: {}, {}, {}, {}, {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), Measure2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.), Measure3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.), ); println!(); } fn print_all_velocity_units() { println!("* Velocity units"); println!( " MetrePerSecond: {}, {}, {}, {}, {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), Measure2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.), Measure3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.), ); println!( " Knot: {} == {}, {} == {}, {} == {}, {} == {}, {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), Measure2d::::new(1., 2.), Measure2d::::new(1., 2.).convert::(), MeasurePoint2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.).convert::(), Measure3d::::new(1., 2., 3.), Measure3d::::new(1., 2., 3.).convert::(), MeasurePoint3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.).convert::(), ); println!( " KiloMetrePerHour: {} == {}, {} == {}, {} == {}, {} == {}, {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), Measure2d::::new(1., 2.), Measure2d::::new(1., 2.).convert::(), MeasurePoint2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.).convert::(), Measure3d::::new(1., 2., 3.), Measure3d::::new(1., 2., 3.).convert::(), MeasurePoint3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.).convert::(), ); println!( " MilePerHour: {} == {}, {} == {}, {} == {}, {} == {}, {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), Measure2d::::new(1., 2.), Measure2d::::new(1., 2.).convert::(), MeasurePoint2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.).convert::(), Measure3d::::new(1., 2., 3.), Measure3d::::new(1., 2., 3.).convert::(), MeasurePoint3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.).convert::(), ); println!( " CentiMetrePerSecond: {} == {}, {} == {}, {} == {}, {} == {}, {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), Measure2d::::new(1., 2.), Measure2d::::new(1., 2.).convert::(), MeasurePoint2d::::new(1., 2.), MeasurePoint2d::::new(1., 2.).convert::(), Measure3d::::new(1., 2., 3.), Measure3d::::new(1., 2., 3.).convert::(), MeasurePoint3d::::new(1., 2., 3.), MeasurePoint3d::::new(1., 2., 3.).convert::(), ); println!(); } fn print_all_volume_units() { println!("* Volume units"); println!( " CubicMetre: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!( " CubicKiloMetre: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " CubicInch: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " CubicFoot: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " CubicYard: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " CubicMile: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " Litre: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " MilliLitre: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " MicroLitre: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " NanoLitre: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " PicoLitre: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " Pint: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!( " Gallon: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!(); } fn print_all_volumetric_flow_rate_units() { println!("* VolumetricFlowRate units"); println!( " CubicMetrePerSecond: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!( " CubicCentiMetrePerSecond: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!(); } fn print_all_wave_number_units() { println!("* WaveNumber units"); println!( " CyclePerMetre: {}, {};", Measure::::new(1.), MeasurePoint::::new(1.), ); println!( " RadianPerMetre: {} == {}, {} == {};", Measure::::new(1.), Measure::::new(1.).convert::(), MeasurePoint::::new(1.), MeasurePoint::::new(1.).convert::(), ); println!(); } fn print_all_units() { print_all_acceleration_units(); print_all_action_units(); print_all_amount_units(); print_all_angle_units(); print_all_angular_acceleration_units(); print_all_angular_momentum_units(); print_all_area_units(); print_all_area_density_units(); print_all_capacitance_units(); print_all_catalytic_activity_units(); print_all_chemical_potential_units(); print_all_current_density_units(); print_all_dimensionless_units(); print_all_dose_equivalent_units(); print_all_dynamic_viscosity_units(); print_all_electrical_conductance_units(); print_all_electrical_conductivity_units(); print_all_electrical_resistance_units(); print_all_electrical_resistivity_units(); print_all_electric_charge_units(); print_all_electric_charge_density_units(); print_all_electric_current_units(); print_all_electric_displacement_units(); print_all_electric_field_strength_units(); print_all_electric_potential_units(); print_all_energy_units(); print_all_energy_density_units(); print_all_entropy_units(); print_all_force_units(); print_all_frequency_units(); print_all_illuminance_units(); print_all_inductance_units(); print_all_information_units(); print_all_information_rate_units(); print_all_irradiance_units(); print_all_kinematic_viscosity_units(); print_all_length_units(); print_all_linear_density_units(); print_all_linear_electric_charge_density_units(); print_all_luminance_units(); print_all_luminous_flux_units(); print_all_luminous_intensity_units(); print_all_magnetic_field_strength_units(); print_all_magnetic_flux_units(); print_all_magnetic_flux_density_units(); print_all_magnetic_permeability_units(); print_all_magnetic_reluctance_units(); print_all_mass_units(); print_all_mass_density_units(); print_all_mass_flow_rate_units(); print_all_molar_concentration_units(); print_all_molar_heat_capacity_units(); print_all_moment_of_inertia_units(); print_all_momentum_units(); print_all_permittivity_units(); print_all_power_units(); print_all_pressure_units(); print_all_radiance_units(); print_all_radiant_intensity_units(); print_all_radioactive_activity_units(); print_all_radioactive_dose_units(); print_all_radioactive_dose_rate_units(); print_all_reaction_rate_units(); print_all_solid_angle_units(); print_all_specific_energy_units(); print_all_specific_heat_capacity_units(); print_all_specific_volume_units(); print_all_square_time_units(); print_all_surface_density_units(); print_all_surface_tension_units(); print_all_temperature_units(); print_all_thermal_conductivity_units(); print_all_time_units(); print_all_torque_units(); print_all_velocity_units(); print_all_volume_units(); print_all_volumetric_flow_rate_units(); print_all_wave_number_units(); } fn print_all_single_unit_operations_for_measure_1d() { println!("* Single unit operations for measure 1d"); { let m1 = Measure::::new(12.); println!( "{m1} can be converted to {m2}.", m2 = m1.convert::() ); } { let m1 = Measure::::new(1.234_567_890_123_456_7); println!( "{m1} can be lossy-converted to {m2}.", m2 = m1.lossy_into::() ); } { let m1 = Measure::::new(1.234_567_9); println!( "{m1} can be lossless-converted to {m2}.", m2 = m1.lossless_into::(), ); } { let m1 = Measure::::new(-12.); println!("The squared norm of {m1} is {n}.", n = m1.squared_norm(),); } { let m1 = Measure::::new(-12.); println!("{m1} normalized is {n}.", n = m1.normalized()); } { let m1 = Measure::::new(12.); println!("The opposite of {m1} is {m2}.", m2 = -m1); } { let mut m1 = Measure::::new(12.); let m2 = Measure::::new(13.); print!("{m1} plus {m2} is {m3},", m3 = m1 + m2); m1 += m2; println!(" and if incremented by {m2}, it becomes {m1}."); } { let mut m1 = Measure::::new(12.); let m2 = Measure::::new(13.); print!("{m1} minus {m2} is {m3},", m3 = m1 - m2); m1 -= m2; println!(" and if decremented by {m2}, it becomes {m1}."); } { let mut m1 = Measure::::new(12.); let multiplier = 2.; print!("{m1} times {multiplier} is {m2},", m2 = m1 * multiplier); m1 *= multiplier; println!(" and if multiplied by {multiplier}, it becomes {m1}."); } { let m1 = Measure::::new(12.); let multiplier = 2.; println!("{multiplier} times {m1} is {m2}.", m2 = multiplier * m1); } { let mut m1 = Measure::::new(12.); let divisor = 2.; print!("{m1} divided by {divisor} is {m2},", m2 = m1 / divisor); m1 /= divisor; println!(" and if divided by {divisor}, it becomes {m1}."); } { let m1 = Measure::::new(12.); let m2 = Measure::::new(4.); println!("{m1} divided by {m2} is {m3}.", m3 = m1 / m2); } { let m1 = Measure::::new(12.); let m2 = m1; println!("{m1} == {m1} is {result}.", result = m1 == m2); println!("{m1} < {m1} is {result}.", result = m1 < m2); } println!(); } fn print_all_single_unit_operations_for_measure_point_1d() { println!("* Single unit operations for measure point 1d"); { let mp1 = MeasurePoint::::new(12.); println!( "{mp1} can be converted to {mp2}.", mp2 = mp1.convert::() ); } { let mp1 = MeasurePoint::::new(1.234_567_890_123_456_7); println!( "{mp1} can be lossy-converted to {mp2}.", mp2 = mp1.lossy_into::() ); } { let mp1 = MeasurePoint::::new(1.234_567_9); println!( "{mp1} can be lossless-converted to {mp2}.", mp2 = mp1.lossless_into::(), ); } { let mut mp1 = MeasurePoint::::new(12.); let m2 = Measure::::new(13.); print!("{mp1} plus {m2} is {mp3},", mp3 = mp1 + m2); mp1 += m2; println!(" and if incremented by {m2}, it becomes {mp1}."); } { let mut mp1 = MeasurePoint::::new(12.); let m2 = Measure::::new(13.); print!("{mp1} minus {m2} is {mp3},", mp3 = mp1 - m2); mp1 -= m2; println!(" and if decremented by {m2}, it becomes {mp1}."); } { let mp1 = MeasurePoint::::new(12.); let mp2 = MeasurePoint::::new(13.); println!("{mp1} minus {mp2} is {m3}.", m3 = mp1 - mp2); } { let mp1 = MeasurePoint::::new(10.); let mp2 = MeasurePoint::::new(20.); println!("The weighted midpoint between {mp1} (with weight 40%) and {mp2} (with weight 60%) is {mp3}.", mp3 = weighted_midpoint(mp1, mp2, 0.4)); println!( "The midpoint between {mp1} and {mp2} is {mp3}.", mp3 = midpoint(mp1, mp2) ); } { let mp1 = MeasurePoint::::new(10.); let mp2 = MeasurePoint::::new(20.); let mp3 = MeasurePoint::::new(40.); println!("The barycentric combination among {mp1} (with weight 10%), {mp2} (with weight 20%), and {mp3} (with weight 70%) is {mp4}.", mp4 = barycentric_combination(&[mp1, mp2, mp3], &[0.1, 0.2, 0.7])); } { let mp1 = MeasurePoint::::new(12.); let mp2 = mp1; println!("{mp1} == {mp1} is {result}.", result = mp1 == mp2); println!("{mp1} < {mp1} is {result}.", result = mp1 < mp2); } println!(); } fn print_all_single_unit_operations_for_unsigned_directions() { println!("* Single unit operations for unsigned directions"); { let mp1 = MeasurePoint::::new(12.); println!( "{ud2} can be created from {mp1}.", ud2 = UnsignedDirection::::from_measure_point(mp1) ); } { let ud1 = UnsignedDirection::::new(12.); println!( "{ud1} can be converted to {mp2}.", mp2 = ud1.to_measure_point() ); } { let ud1 = UnsignedDirection::::new(12.); println!( "{ud1} can be converted to {sd2}.", sd2 = ud1.to_signed_direction() ); } { let ud1 = UnsignedDirection::::new(12.); println!( "{ud1} can be converted to {ud2}.", ud2 = ud1.convert::() ); } { let ud1 = UnsignedDirection::::new(1.234_567_890_123_456_7); println!( "{ud1} can be lossy-converted to {ud2}.", ud2 = ud1.lossy_into::() ); } { let ud1 = UnsignedDirection::::new(1.234_567_9); println!( "{ud1} can be lossless-converted to {ud2}.", ud2 = ud1.lossless_into::(), ); } { let mut ud1 = UnsignedDirection::::new(12.); let m2 = Measure::::new(13.); print!("{ud1} plus {m2} is {ud3},", ud3 = ud1 + m2); ud1 += m2; println!(" and if incremented by {m2}, it becomes {ud1}."); } { let mut ud1 = UnsignedDirection::::new(12.); let m2 = Measure::::new(13.); print!("{ud1} minus {m2} is {ud3},", ud3 = ud1 - m2); ud1 -= m2; println!(" and if decremented by {m2}, it becomes {ud1}."); } { let ud1 = UnsignedDirection::::new(12.); let ud2 = UnsignedDirection::::new(13.); println!("{ud1} minus {ud2} is {m3}.", m3 = ud1 - ud2); } { let ud1 = UnsignedDirection::::new(12.); let ud2 = ud1; println!("{ud1} == {ud1} is {result}.", result = ud1 == ud2); println!("{ud1} < {ud1} is {result}.", result = ud1 < ud2); } println!(); } fn print_all_single_unit_operations_for_signed_directions() { println!("* Single unit operations for signed directions"); { let mp1 = MeasurePoint::::new(12.); println!( "{sd2} can be created from {mp1}.", sd2 = SignedDirection::::from_measure_point(mp1) ); } { let sd1 = SignedDirection::::new(12.); println!( "{sd1} can be converted to {mp2}.", mp2 = sd1.to_measure_point() ); } { let sd1 = SignedDirection::::new(12.); println!( "{sd1} can be converted to {ud2}.", ud2 = sd1.to_unsigned_direction() ); } { let sd1 = SignedDirection::::new(12.); println!( "{sd1} can be converted to {sd2}.", sd2 = sd1.convert::() ); } { let sd1 = SignedDirection::::new(1.234_567_890_123_456_7); println!( "{sd1} can be lossy-converted to {sd2}.", sd2 = sd1.lossy_into::() ); } { let sd1 = SignedDirection::::new(1.234_567_9); println!( "{sd1} can be lossless-converted to {sd2}.", sd2 = sd1.lossless_into::(), ); } { let mut sd1 = SignedDirection::::new(12.); let m2 = Measure::::new(13.); print!("{sd1} plus {m2} is {sd3},", sd3 = sd1 + m2); sd1 += m2; println!(" and if incremented by {m2}, it becomes {sd1}."); } { let mut sd1 = SignedDirection::::new(12.); let m2 = Measure::::new(13.); print!("{sd1} minus {m2} is {sd3},", sd3 = sd1 - m2); sd1 -= m2; println!(" and if decremented by {m2}, it becomes {sd1}."); } { let sd1 = SignedDirection::::new(12.); let sd2 = SignedDirection::::new(13.); println!("{sd1} minus {sd2} is {m3}.", m3 = sd1 - sd2); } { let sd1 = SignedDirection::::new(12.); let sd2 = sd1; println!("{sd1} == {sd1} is {result}.", result = sd1 == sd2); println!("{sd1} < {sd1} is {result}.", result = sd1 < sd2); } println!(); } fn print_all_single_unit_operations_for_measure_2d() { println!("* Single unit operations for measure 2d"); { let m1 = Measure2d::::new(12., 13.); println!( "{m1} has components X={m2} and Y={m3}.", m2 = m1.x(), m3 = m1.y(), ); } { let m1 = Measure2d::::new(12., 13.); println!( "{m1} can be converted to {m2}.", m2 = m1.convert::() ); } { let m1 = Measure2d::::new(1.234_567_890_123_456_7, 2.345_678_901_234_568); println!( "{m1} can be lossy-converted to {m2}.", m2 = m1.lossy_into::() ); } { let m1 = Measure2d::::new(1.234_567_9, 2.345_678_8); println!( "{m1} can be lossless-converted to {m2}.", m2 = m1.lossless_into::(), ); } { let m1 = Measure2d::::new(-12., -13.); println!("The squared norm of {m1} is {n}.", n = m1.squared_norm()); } { let m1 = Measure2d::::new(-12., -13.); println!("{m1} normalized is {n}.", n = m1.normalized()); } { let mp1 = MeasurePoint::::new(12.); println!( "{m1} can be created from angle {mp1}.", m1 = Measure2d::::from_direction(mp1) ); } { let m1 = Measure2d::::new(12., 13.); println!( "{m1} has signed direction {sd2}.", sd2 = m1.signed_direction::() ); } { let m1 = Measure2d::::new(12., 13.); println!( "{m1} has unsigned direction {ud2}.", ud2 = m1.unsigned_direction::() ); } { let m1 = Measure2d::::new(12., -13.); println!("The opposite of {m1} is {m2}.", m2 = -m1); } { let mut m1 = Measure2d::::new(12., 13.); let m2 = Measure2d::::new(15., 19.); print!("{m1} plus {m2} is {m3},", m3 = m1 + m2); m1 += m2; println!(" and if incremented by {m2}, it becomes {m1}."); } { let mut m1 = Measure2d::::new(12., 13.); let m2 = Measure2d::::new(15., 19.); print!("{m1} minus {m2} is {m3},", m3 = m1 - m2); m1 -= m2; println!(" and if decremented by {m2}, it becomes {m1}."); } { let mut m1 = Measure2d::::new(12., 13.); let multiplier = 2.; print!("{m1} times {multiplier} is {m2},", m2 = m1 * multiplier); m1 *= multiplier; println!(" and if multiplied by {multiplier}, it becomes {m1}."); } { let m1 = Measure2d::::new(12., 13.); let multiplier = 2.; println!("{multiplier} times {m1} is {m2}.", m2 = multiplier * m1); } { let mut m1 = Measure2d::::new(12., 13.); let divisor = 2.; print!("{m1} divided by {divisor} is {m2},", m2 = m1 / divisor); m1 /= divisor; println!(" and if divided by {divisor}, it becomes {m1}."); } { let m1 = Measure2d::::new(12., 13.); let m2 = m1; println!("{m1} == {m1} is {result}.", result = m1 == m2); } println!(); } fn print_all_single_unit_operations_for_measure_point_2d() { println!("* Single unit operations for measure point 2d"); { let mp1 = MeasurePoint2d::::new(12., 13.); println!( "{mp1} has components X={mp2} and Y={mp3}.", mp2 = mp1.x(), mp3 = mp1.y(), ); } { let mp1 = MeasurePoint2d::::new(12., 13.); println!( "{mp1} can be converted to {mp2}.", mp2 = mp1.convert::() ); } { let mp1 = MeasurePoint2d::::new(1.234_567_890_123_456_7, 2.345_678_901_234_568); println!( "{mp1} can be lossy-converted to {mp2}.", mp2 = mp1.lossy_into::() ); } { let mp1 = MeasurePoint2d::::new(1.234_567_9, 2.345_678_8); println!( "{mp1} can be lossless-converted to {mp2}.", mp2 = mp1.lossless_into::(), ); } { let mut mp1 = MeasurePoint2d::::new(12., 13.); let m2 = Measure2d::::new(15., 19.); print!("{mp1} plus {m2} is {mp3},", mp3 = mp1 + m2); mp1 += m2; println!(" and if incremented by {m2}, it becomes {mp1}."); } { let mut mp1 = MeasurePoint2d::::new(12., 13.); let m2 = Measure2d::::new(15., 19.); print!("{mp1} minus {m2} is {mp3},", mp3 = mp1 - m2); mp1 -= m2; println!(" and if decremented by {m2}, it becomes {mp1}."); } { let mp1 = MeasurePoint2d::::new(12., 13.); let mp2 = MeasurePoint2d::::new(15., 19.); println!("{mp1} minus {mp2} is {m3},", m3 = mp1 - mp2); } { let mp1 = MeasurePoint2d::::new(10., -100.); let mp2 = MeasurePoint2d::::new(20., -200.); println!("The weighted midpoint between {mp1} (with weight 40%) and {mp2} (with weight 60%) is {mp3}.", mp3 = weighted_midpoint_2d(mp1, mp2, 0.4)); println!( "The midpoint between {mp1} and {mp2} is {mp3}.", mp3 = midpoint_2d(mp1, mp2) ); } { let mp1 = MeasurePoint2d::::new(10., -100.); let mp2 = MeasurePoint2d::::new(20., -200.); let mp3 = MeasurePoint2d::::new(40., -400.); println!("The barycentric combination among {mp1} (with weight 10%), {mp2} (with weight 20%), and {mp3} (with weight 70%) is {mp4}.", mp4 = barycentric_combination_2d(&[mp1, mp2, mp3], &[0.1, 0.2, 0.7])); } { let mp1 = MeasurePoint2d::::new(12., 13.); let mp2 = mp1; println!("{mp1} == {mp1} is {result}.", result = mp1 == mp2); } println!(); } fn print_all_single_unit_operations_for_measure_3d() { println!("* Single unit operations for measure 3d"); { let m1 = Measure3d::::new(12., 13., 14.); println!( "{m1} has components X={m2}, Y={m3}, and Z={m4}.", m2 = m1.x(), m3 = m1.y(), m4 = m1.z(), ); } { let m1 = Measure3d::::new(12., 13., 14.); println!( "{m1} can be converted to {m2}.", m2 = m1.convert::() ); } { let m1 = Measure3d::::new( 1.234_567_890_123_456_7, 2.345_678_901_234_568, 3.456_789_012_345_679, ); println!( "{m1} can be lossy-converted to {m2}.", m2 = m1.lossy_into::() ); } { let m1 = Measure3d::::new(1.234_567_9, 2.345_678_8, 3.456_789); println!( "{m1} can be lossless-converted to {m2}.", m2 = m1.lossless_into::(), ); } { let m1 = Measure3d::::new(-12., -13., -14.); println!("The squared norm of {m1} is {n}.", n = m1.squared_norm()); } { let m1 = Measure3d::::new(-12., -13., -14.); println!("{m1} normalized is {n}.", n = m1.normalized()); } { let m1 = Measure3d::::new(12., -13., -14.); println!("The opposite of {m1} is {m2}.", m2 = -m1); } { let mut m1 = Measure3d::::new(12., 13., 14.); let m2 = Measure3d::::new(15., 19., 26.); print!("{m1} plus {m2} is {m3},", m3 = m1 + m2); m1 += m2; println!(" and if incremented by {m2}, it becomes {m1}."); } { let mut m1 = Measure3d::::new(12., 13., 14.); let m2 = Measure3d::::new(15., 19., 26.); print!("{m1} minus {m2} is {m3},", m3 = m1 - m2); m1 -= m2; println!(" and if decremented by {m2}, it becomes {m1}."); } { let mut m1 = Measure3d::::new(12., 13., 14.); let multiplier = 2.; print!("{m1} times {multiplier} is {m2},", m2 = m1 * multiplier); m1 *= multiplier; println!(" and if multiplied by {multiplier}, it becomes {m1}."); } { let m1 = Measure3d::::new(12., 13., 14.); let multiplier = 2.; println!("{multiplier} times {m1} is {m2}.", m2 = multiplier * m1); } { let mut m1 = Measure3d::::new(12., 13., 14.); let divisor = 2.; print!("{m1} divided by {divisor} is {m2},", m2 = m1 / divisor); m1 /= divisor; println!(" and if divided by {divisor}, it becomes {m1}."); } { let m1 = Measure3d::::new(12., 13., 14.); let m2 = m1; println!("{m1} == {m1} is {result}.", result = m1 == m2); } println!(); } fn print_all_single_unit_operations_for_measure_point_3d() { println!("* Single unit operations for measure point 3d"); { let mp1 = MeasurePoint3d::::new(12., 13., 14.); println!( "{mp1} has components X={mp2} and Y={mp3}.", mp2 = mp1.x(), mp3 = mp1.y(), ); } { let mp1 = MeasurePoint3d::::new(12., 13., 14.); println!( "{mp1} can be converted to {mp2}.", mp2 = mp1.convert::() ); } { let mp1 = MeasurePoint3d::::new( 1.234_567_890_123_456_7, 2.345_678_901_234_568, 3.456_789_012_345_679, ); println!( "{mp1} can be lossy-converted to {mp2}.", mp2 = mp1.lossy_into::() ); } { let mp1 = MeasurePoint3d::::new(1.234_567_9, 2.345_678_8, 3.456_789); println!( "{mp1} can be lossless-converted to {mp2}.", mp2 = mp1.lossless_into::(), ); } { let mut mp1 = MeasurePoint3d::::new(12., 13., 14.); let m2 = Measure3d::::new(15., 19., 26.); print!("{mp1} plus {m2} is {mp3},", mp3 = mp1 + m2); mp1 += m2; println!(" and if incremented by {m2}, it becomes {mp1}."); } { let mut mp1 = MeasurePoint3d::::new(12., 13., 14.); let m2 = Measure3d::::new(15., 19., 26.); print!("{mp1} minus {m2} is {mp3},", mp3 = mp1 - m2); mp1 -= m2; println!(" and if decremented by {m2}, it becomes {mp1}."); } { let mp1 = MeasurePoint3d::::new(12., 13., 14.); let mp2 = MeasurePoint3d::::new(15., 19., 26.); println!("{mp1} minus {mp2} is {m3},", m3 = mp1 - mp2); } { let mp1 = MeasurePoint3d::::new(10., -100., 40.); let mp2 = MeasurePoint3d::::new(20., -200., 80.); println!("The weighted midpoint between {mp1} (with weight 40%) and {mp2} (with weight 60%) is {mp3}.", mp3 = weighted_midpoint_3d(mp1, mp2, 0.4)); println!( "The midpoint between {mp1} and {mp2} is {mp3}.", mp3 = midpoint_3d(mp1, mp2) ); } { let mp1 = MeasurePoint3d::::new(10., -100., 40.); let mp2 = MeasurePoint3d::::new(20., -200., 80.); let mp3 = MeasurePoint3d::::new(40., -400., 160.); println!("The barycentric combination among {mp1} (with weight 10%), {mp2} (with weight 20%), and {mp3} (with weight 70%) is {mp4}.", mp4 = barycentric_combination_3d(&[mp1, mp2, mp3], &[0.1, 0.2, 0.7])); } { let mp1 = MeasurePoint3d::::new(12., 13., 14.); let mp2 = mp1; println!("{mp1} == {mp1} is {result}.", result = mp1 == mp2); } println!(); } fn print_all_single_unit_operations() { print_all_single_unit_operations_for_measure_1d(); print_all_single_unit_operations_for_measure_point_1d(); print_all_single_unit_operations_for_unsigned_directions(); print_all_single_unit_operations_for_signed_directions(); print_all_single_unit_operations_for_measure_2d(); print_all_single_unit_operations_for_measure_point_2d(); print_all_single_unit_operations_for_measure_3d(); print_all_single_unit_operations_for_measure_point_3d(); } fn print_all_computer_science_mixed_operations() { println!("* Computer science mixed operations"); { let information = Measure::::new(6.); let time = Measure::::new(2.); let information_rate: Measure = information / time; println!("{information} every {time} is a rate of {information_rate}.") } { let information = Measure::::new(6.); let time = Measure::::new(2.); let information_rate: Measure = information / time; println!("{information} every {time} is a rate of {information_rate}.") } { let information = Measure::::new(6.); let time = Measure::::new(2.); let information_rate: Measure = information / time; println!("{information} every {time} is a rate of {information_rate}.") } { let information = Measure::::new(6.); let time = Measure::::new(2.); let information_rate: Measure = information / time; println!("{information} every {time} is a rate of {information_rate}.") } { let information = Measure::::new(6.); let time = Measure::::new(2.); let information_rate: Measure = information / time; println!("{information} every {time} is a rate of {information_rate}.") } { let information = Measure::::new(6.); let time = Measure::::new(2.); let information_rate: Measure = information / time; println!("{information} every {time} is a rate of {information_rate}.") } { let information = Measure::::new(6.); let time = Measure::::new(2.); let information_rate: Measure = information / time; println!("{information} every {time} is a rate of {information_rate}.") } { let information = Measure::::new(6.); let time = Measure::::new(2.); let information_rate: Measure = information / time; println!("{information} every {time} is a rate of {information_rate}") } { let information = Measure::::new(6.); let time = Measure::::new(2.); let information_rate: Measure = information / time; println!("{information} every {time} is a rate of {information_rate}.") } { let information = Measure::::new(6.); let time = Measure::::new(2.); let information_rate: Measure = information / time; println!("{information} every {time} is a rate of {information_rate}.") } { let information = Measure::::new(6.); let time = Measure::::new(2.); let information_rate: Measure = information / time; println!("{information} every {time} is a rate of {information_rate}.") } { let information = Measure::::new(6.); let time = Measure::::new(2.); let information_rate: Measure = information / time; println!("{information} every {time} is a rate of {information_rate}.") } { let information = Measure::::new(6.); let time = Measure::::new(2.); let information_rate: Measure = information / time; println!("{information} every {time} is a rate of {information_rate}.") } { let information = Measure::::new(6.); let time = Measure::::new(2.); let information_rate: Measure = information / time; println!("{information} every {time} is a rate of {information_rate}.") } { let information = Measure::::new(6.); let time = Measure::::new(2.); let information_rate: Measure = information / time; println!("{information} every {time} is a rate of {information_rate}.") } { let information = Measure::::new(6.); let time = Measure::::new(2.); let information_rate: Measure = information / time; println!("{information} every {time} is a rate of {information_rate}.") } { let information = Measure::::new(6.); let time = Measure::::new(2.); let information_rate: Measure = information / time; println!("{information} every {time} is a rate of {information_rate}.") } { let information = Measure::::new(6.); let time = Measure::::new(2.); let information_rate: Measure = information / time; println!("{information} every {time} is a rate of {information_rate}.") } println!(); } fn print_all_geometry_mixed_operations() { println!("* Geometry mixed operations"); { let length = Measure::::new(6.); let width = Measure::::new(2.); let area: Measure = length * width; println!("A rectangle {length} long and {width} wide has an area of {area}.") } { let length = Measure::::new(6.); let width = Measure::::new(2.); let area: Measure = length * width; println!("A rectangle {length} long and {width} wide has an area of {area}.") } { let length = Measure::::new(6.); let width = Measure::::new(2.); let area: Measure = length * width; println!("A rectangle {length} long and {width} wide has an area of {area}.") } { let length = Measure::::new(6.); let width = Measure::::new(2.); let area: Measure = length * width; println!("A rectangle {length} long and {width} wide has an area of {area}.") } { let length = Measure::::new(6.); let width = Measure::::new(2.); let area: Measure = length * width; println!("A rectangle {length} long and {width} wide has an area of {area}.") } { let length = Measure::::new(6.); let width = Measure::::new(2.); let area: Measure = length * width; println!("A rectangle {length} long and {width} wide has an area of {area}.") } { let length = Measure::::new(6.); let width = Measure::::new(2.); let area: Measure = length * width; println!("A rectangle {length} long and {width} wide has an area of {area}.") } { let length = Measure::::new(6.); let width = Measure::::new(2.); let area: Measure = length * width; println!("A rectangle {length} long and {width} wide has an area of {area}.") } { let length = Measure::::new(6.); let width = Measure::::new(2.); let area: Measure = length * width; println!("A rectangle {length} long and {width} wide has an area of {area}.") } { let length = Measure::::new(6.); let width = Measure::::new(2.); let area: Measure = length * width; println!("A rectangle {length} long and {width} wide has an area of {area}.") } { let length = Measure::::new(6.); let width = Measure::::new(2.); let area: Measure = length * width; println!("A rectangle {length} long and {width} wide has an area of {area}.") } { let length = Measure::::new(6.); let width = Measure::::new(2.); let area: Measure = length * width; println!("A rectangle {length} long and {width} wide has an area of {area}.") } { let length = Measure::::new(6.); let width = Measure::::new(2.); let area: Measure = length * width; println!("A rectangle {length} long and {width} wide has an area of {area}.") } { let base = Measure::::new(6.); let height = Measure::::new(2.); let volume: Measure = base * height; println!( "A prism having a base of {base} and a height of {height} has a volume of {volume}." ) } { let base = Measure::::new(6.); let height = Measure::::new(2.); let volume: Measure = base * height; println!( "A prism having a base of {base} and a height of {height} has a volume of {volume}." ) } { let base = Measure::::new(6.); let height = Measure::::new(2.); let volume: Measure = base * height; println!( "A prism having a base of {base} and a height of {height} has a volume of {volume}." ) } { let base = Measure::::new(6.); let height = Measure::::new(2.); let volume: Measure = base * height; println!( "A prism having a base of {base} and a height of {height} has a volume of {volume}." ) } { let base = Measure::::new(6.); let height = Measure::::new(2.); let volume: Measure = base * height; println!( "A prism having a base of {base} and a height of {height} has a volume of {volume}." ) } { let base = Measure::::new(6.); let height = Measure::::new(2.); let volume: Measure = base * height; println!( "A prism having a base of {base} and a height of {height} has a volume of {volume}." ) } { let base = Measure::::new(6.); let height = Measure::::new(2.); let volume: Measure = base * height; println!( "A prism having a base of {base} and a height of {height} has a volume of {volume}." ) } { let base = Measure::::new(6.); let height = Measure::::new(2.); let volume: Measure = base * height; println!( "A prism having a base of {base} and a height of {height} has a volume of {volume}." ) } { let base = Measure::::new(6.); let height = Measure::::new(2.); let volume: Measure = base * height; println!( "A prism having a base of {base} and a height of {height} has a volume of {volume}." ) } { let base = Measure::::new(6.); let height = Measure::::new(2.); let volume: Measure = base * height; println!( "A prism having a base of {base} and a height of {height} has a volume of {volume}." ) } { let base = Measure::::new(6.); let height = Measure::::new(2.); let volume: Measure = base * height; println!( "A prism having a base of {base} and a height of {height} has a volume of {volume}." ) } { let phase = Measure::::new(6.); let length = Measure::::new(2.); let wave_number: Measure = phase / length; println!("A portion of wave having a phase of {phase} for a length of {length} has a wave number of {wave_number}.") } { let phase = Measure::::new(6.); let length = Measure::::new(2.); let wave_number: Measure = phase / length; println!("A portion of wave having a phase of {phase} for a length of {length} has a wave number of {wave_number}.") } println!(); } fn print_all_kinematics_mixed_operations() { println!("* Kinematics mixed operations"); { let velocity = Measure::::new(6.); let time = Measure::::new(2.); let acceleration: Measure = velocity / time; println!("If an object in a line changes its velocity of {velocity} in a time interval of {time}, it has an average acceleration of {acceleration}.") } { let velocity = Measure2d::::new(6., 20.); let time = Measure::::new(2.); let acceleration: Measure2d = velocity / time; println!("If an object in a plane changes its velocity of {velocity} in a time interval of {time}, it has an average acceleration of {acceleration}.") } { let velocity = Measure3d::::new(6., 20., 36.); let time = Measure::::new(2.); let acceleration: Measure3d = velocity / time; println!("If an object in the space changes its velocity of {velocity} in a time interval of {time}, it has an average acceleration of {acceleration}.") } { let velocity = Measure::::new(6.); let time = Measure::::new(2.); let acceleration: Measure = velocity / time; println!("If an object in a line changes its velocity of {velocity} in a time interval of {time}, it has an average acceleration of {acceleration}.") } { let velocity = Measure2d::::new(6., 20.); let time = Measure::::new(2.); let acceleration: Measure2d = velocity / time; println!("If an object in a plane changes its velocity of {velocity} in a time interval of {time}, it has an average acceleration of {acceleration}.") } { let velocity = Measure3d::::new(6., 20., 36.); let time = Measure::::new(2.); let acceleration: Measure3d = velocity / time; println!("If an object in the space changes its velocity of {velocity} in a time interval of {time}, it has an average acceleration of {acceleration}.") } { let velocity = Measure::::new(6.); let time = Measure::::new(2.); let acceleration: Measure = velocity / time; println!("If an object in a line changes its velocity of {velocity} in a time interval of {time}, it has an average acceleration of {acceleration}.") } { let velocity = Measure2d::::new(6., 20.); let time = Measure::::new(2.); let acceleration: Measure2d = velocity / time; println!("If an object in a plane changes its velocity of {velocity} in a time interval of {time}, it has an average acceleration of {acceleration}.") } { let velocity = Measure3d::::new(6., 20., 36.); let time = Measure::::new(2.); let acceleration: Measure3d = velocity / time; println!("If an object in the space changes its velocity of {velocity} in a time interval of {time}, it has an average acceleration of {acceleration}.") } { let length = Measure::::new(6.); let time = Measure::::new(2.); let velocity: Measure = length / time; println!("If an object moves in a line by a distance of {length} in a time interval of {time}, it has an average velocity of {velocity}.") } { let length = Measure2d::::new(6., 20.); let time = Measure::::new(2.); let velocity: Measure2d = length / time; println!("If an object moves in a plane by a distance of {length} in a time interval of {time}, it has an average velocity of {velocity}.") } { let length = Measure3d::::new(6., 20., 36.); let time = Measure::::new(2.); let velocity: Measure3d = length / time; println!("If an object moves in the space by a distance of {length} in a time interval of {time}, it has an average velocity of {velocity}.") } { let length = Measure::::new(6.); let time = Measure::::new(2.); let velocity: Measure = length / time; println!("If an object moves in a line by a distance of {length} in a time interval of {time}, it has an average velocity of {velocity}.") } { let length = Measure2d::::new(6., 20.); let time = Measure::::new(2.); let velocity: Measure2d = length / time; println!("If an object moves in a plane by a distance of {length} in a time interval of {time}, it has an average velocity of {velocity}.") } { let length = Measure3d::::new(6., 20., 36.); let time = Measure::::new(2.); let velocity: Measure3d = length / time; println!("If an object moves in the space by a distance of {length} in a time interval of {time}, it has an average velocity of {velocity}.") } { let length = Measure::::new(6.); let time = Measure::::new(2.); let velocity: Measure = length / time; println!("If an object moves in a line by a distance of {length} in a time interval of {time}, it has an average velocity of {velocity}.") } { let length = Measure2d::::new(6., 20.); let time = Measure::::new(2.); let velocity: Measure2d = length / time; println!("If an object moves in a plane by a distance of {length} in a time interval of {time}, it has an average velocity of {velocity}.") } { let length = Measure3d::::new(6., 20., 36.); let time = Measure::::new(2.); let velocity: Measure3d = length / time; println!("If an object moves in the space by a distance of {length} in a time interval of {time}, it has an average velocity of {velocity}.") } { let length = Measure::::new(6.); let time = Measure::::new(2.); let velocity: Measure = length / time; println!("If an object moves in a line by a distance of {length} in a time interval of {time}, it has an average velocity of {velocity}.") } { let length = Measure2d::::new(6., 20.); let time = Measure::::new(2.); let velocity: Measure2d = length / time; println!("If an object moves in a plane by a distance of {length} in a time interval of {time}, it has an average velocity of {velocity}.") } { let length = Measure3d::::new(6., 20., 36.); let time = Measure::::new(2.); let velocity: Measure3d = length / time; println!("If an object moves in the space by a distance of {length} in a time interval of {time}, it has an average velocity of {velocity}.") } { let length = Measure::::new(6.); let time = Measure::::new(2.); let velocity: Measure = length / time; println!("If an object moves in a line by a distance of {length} in a time interval of {time}, it has an average velocity of {velocity}.") } { let length = Measure2d::::new(6., 20.); let time = Measure::::new(2.); let velocity: Measure2d = length / time; println!("If an object moves in a plane by a distance of {length} in a time interval of {time}, it has an average velocity of {velocity}.") } { let length = Measure3d::::new(6., 20., 36.); let time = Measure::::new(2.); let velocity: Measure3d = length / time; println!("If an object moves in the space by a distance of {length} in a time interval of {time}, it has an average velocity of {velocity}.") } { let angular_velocity = Measure::::new(6.); let time = Measure::::new(2.); let angular_acceleration: Measure = angular_velocity / time; println!("If an object changes its angular velocity by {angular_velocity} in a time interval of {time}, it has an average angular acceleration of {angular_acceleration}.") } { let angular_position = Measure::::new(6.); let time = Measure::::new(2.); let angular_velocity: Measure = angular_position / time; println!("If an object changes its angular position (or phase) by {angular_position} in a time interval of {time}, it has an average angular velocity (or average frequency) of {angular_velocity}.") } { let angular_position = Measure::::new(6.); let time = Measure::::new(2.); let angular_velocity: Measure = angular_position / time; println!("If an object changes its angular position (or phase) by {angular_position} in a time interval of {time}, it has an average angular velocity (or average frequency) of {angular_velocity}.") } { let angular_position = Measure::::new(6.); let time = Measure::::new(2.); let angular_velocity: Measure = angular_position / time; println!("If an object changes its angular position (or phase) by {angular_position} in a time interval of {time}, it has an average angular velocity (or average frequency) of {angular_velocity}.") } // TODO KinematicViscosity // TODO SquareTime { let volume = Measure::::new(6.); let time = Measure::::new(2.); let flow_rate: Measure = volume / time; println!("If some fluid having a volume of {volume} crosses a surface in a time interval of {time}, that fluid has an average volumetric flow rate of {flow_rate}.") } { let volume = Measure::::new(6.); let time = Measure::::new(2.); let flow_rate: Measure = volume / time; println!("If some fluid having a volume of {volume} crosses a surface in a time interval of {time}, that fluid has an average volumetric flow rate of {flow_rate}.") } { let area = Measure::::new(6.); let velocity = Measure::::new(2.); let flow_rate: Measure = area * velocity; println!("If some fluid crosses a surface with area {area} having a velocity of {velocity}, that fluid has an average volumetric flow rate of {flow_rate}.") } { let area = Measure::::new(6.); let velocity = Measure::::new(2.); let flow_rate: Measure = area * velocity; println!("If some fluid crosses a surface with area {area} having a velocity of {velocity}, that fluid has an average volumetric flow rate of {flow_rate}.") } println!(); } fn print_all_dynamics_mixed_operations() { println!("* Dynamics mixed operations"); // TODO Action == Energy * Time // TODO Action == Power * SquareTime { let impulse = Measure2d::::new(6., 2.); let arm = Measure2d::::new(1., 4.); let angular_momentum: Measure = impulse.cross_product(arm); println!("If some object constrained to rotate around an axis receives an impulse of {impulse} laying in the plane orthogonal to the axis, applied at a position from the rotation axis of {arm}, that causes a variation of the angular momentum by {angular_momentum}.") } { let impulse = Measure3d::::new(6., 2., -3.); let arm = Measure3d::::new(1., 4., 6.); let angular_momentum: Measure3d = impulse.cross_product(arm); println!("If some object constrained to rotate around a point receives an impulse of {impulse}, applied at a position from the rotation point of {arm}, that causes a variation of the angular momentum by {angular_momentum}.") } // TODO AngularMomentum == MomentOfInertia / Time // TODO DynamicViscosity == Pressure * Time { let force = Measure::::new(6.); let movement = Measure::::new(2.); let work: Measure = force * movement; println!("If a force of {force} is applied to an object while it moves in the same direction by {movement}, that force gives to that object an energy of {work}.") } { let force = Measure2d::::new(6., -3.); let movement = Measure2d::::new(2., 5.); let work: Measure = force * movement; println!("If a planar force of {force} is applied to an object while it moves in the same plane by {movement}, that force gives to that object an energy of {work}.") } { let force = Measure3d::::new(6., -3., 5.); let movement = Measure3d::::new(2., 5., 7.); let work: Measure = force * movement; println!("If a force of {force} is applied to an object while it moves in space by {movement}, that force gives to that object an energy of {work}.") } { let force = Measure::::new(6.); let movement = Measure::::new(2.); let work: Measure = force * movement; println!("If a force of {force} is applied to an object while it moves in the same direction by {movement}, that force gives to that object an energy of {work}.") } { let force = Measure2d::::new(6., -3.); let movement = Measure2d::::new(2., 5.); let work: Measure = force * movement; println!("If a planar force of {force} is applied to an object while it moves in the same plane by {movement}, that force gives to that object an energy of {work}.") } { let force = Measure3d::::new(6., -3., 5.); let movement = Measure3d::::new(2., 5., 7.); let work: Measure = force * movement; println!("If a force of {force} is applied to an object while it moves in space by {movement}, that force gives to that object an energy of {work}.") } // TODO Energy == Momentum * Velocity // TODO Energy == MomentOfInertia / SquareTime // EnergyDensity == Energy / Volume { let energy = Measure::::new(6.); let volume = Measure::::new(2.); let energy_density: Measure = energy / volume; println!("If an energy of {energy} is contained in a volume of {volume}, it has an average energy density of {energy_density}.") } { let force = Measure::::new(6.); let mass = Measure::::new(2.); let acceleration: Measure = force / mass; println!("If a force of {force} is applied to an object having mass {mass}, that object is accelerated along the direction of the force by {acceleration}.") } { let force = Measure2d::::new(6., -3.); let mass = Measure::::new(2.); let acceleration: Measure2d = force / mass; println!("If a force of {force} is applied in a plane to an object having mass {mass}, that object is accelerated in that plane by {acceleration}.") } { let force = Measure3d::::new(6., -3., 5.); let mass = Measure::::new(2.); let acceleration: Measure3d = force / mass; println!("If a force of {force} is applied in space to an object having mass {mass}, that object is accelerated by {acceleration}.") } { let force = Measure::::new(6.); let mass = Measure::::new(2.); let acceleration: Measure = force / mass; println!("If a force of {force} is applied to an object having mass {mass}, that object is accelerated along the direction of the force by {acceleration}.") } { let force = Measure2d::::new(6., -3.); let mass = Measure::::new(2.); let acceleration: Measure2d = force / mass; println!("If a force of {force} is applied in a plane to an object having mass {mass}, that object is accelerated in that plane by {acceleration}.") } { let force = Measure3d::::new(6., -3., 5.); let mass = Measure::::new(2.); let acceleration: Measure3d = force / mass; println!("If a force of {force} is applied in space to an object having mass {mass}, that object is accelerated by {acceleration}.") } { let force = Measure::::new(6.); let mass = Measure::::new(2.); let acceleration: Measure = force / mass; println!("If a force of {force} is applied to an object having mass {mass}, that object is accelerated along the direction of the force by {acceleration}.") } { let force = Measure2d::::new(6., -3.); let mass = Measure::::new(2.); let acceleration: Measure2d = force / mass; println!("If a force of {force} is applied in a plane to an object having mass {mass}, that object is accelerated in that plane by {acceleration}.") } { let force = Measure3d::::new(6., -3., 5.); let mass = Measure::::new(2.); let acceleration: Measure3d = force / mass; println!("If a force of {force} is applied in space to an object having mass {mass}, that object is accelerated by {acceleration}.") } { let mass = Measure::::new(6.); let length = Measure::::new(2.); let linear_density: Measure = mass / length; println!("If a mass of {mass} is distributed along a length of {length}, that mass has a linear density by {linear_density}.") } { let mass = Measure::::new(6.); let length = Measure::::new(2.); let linear_density: Measure = mass / length; println!("If a mass of {mass} is distributed along a length of {length}, that mass has a linear density by {linear_density}.") } { let mass = Measure::::new(6.); let volume = Measure::::new(2.); let space_density: Measure = mass / volume; println!("If a mass of {mass} occupies a volume of {volume}, it has a density by {space_density}.") } { let mass = Measure::::new(6.); let volume = Measure::::new(2.); let space_density: Measure = mass / volume; println!("If a mass of {mass} occupies a volume of {volume}, it has a density by {space_density}.") } { let mass = Measure::::new(6.); let time = Measure::::new(2.); let mass_flow_rate: Measure = mass / time; println!("If a mass of {mass} crosses a surface in a time interval of {time}, it has a mass flow rate of {mass_flow_rate}.") } { let mass = Measure::::new(6.); let time = Measure::::new(2.); let mass_flow_rate: Measure = mass / time; println!("If a mass of {mass} crosses a surface in a time interval of {time}, it has a mass flow rate of {mass_flow_rate}.") } // TODO MomentOfInertia == Mass * Area // TODO Momentum == Force * Time { let mass = Measure::::new(6.); let velocity = Measure::::new(2.); let momentum: Measure = mass * velocity; println!("A mass of {mass} having a velocity in a line of {velocity} has a momentum of {momentum}.") } { let mass = Measure::::new(6.); let velocity = Measure2d::::new(2., 5.); let momentum: Measure2d = mass * velocity; println!("A mass of {mass} having a velocity in a plane of {velocity} has a momentum of {momentum}.") } { let mass = Measure::::new(6.); let velocity = Measure3d::::new(2., 5., -3.); let momentum: Measure3d = mass * velocity; println!("A mass of {mass} having a velocity in space of {velocity} has a momentum of {momentum}.") } { let mass = Measure::::new(6.); let velocity = Measure::::new(2.); let momentum: Measure = mass * velocity; println!("A mass of {mass} having a velocity in a line of {velocity} has a momentum of {momentum}.") } { let mass = Measure::::new(6.); let velocity = Measure2d::::new(2., 5.); let momentum: Measure2d = mass * velocity; println!("A mass of {mass} having a velocity in a plane of {velocity} has a momentum of {momentum}.") } { let mass = Measure::::new(6.); let velocity = Measure3d::::new(2., 5., -3.); let momentum: Measure3d = mass * velocity; println!("A mass of {mass} having a velocity in space of {velocity} has a momentum of {momentum}.") } { let energy = Measure::::new(6.); let time = Measure::::new(2.); let power: Measure = energy / time; println!("A system generating or consuming the energy of {energy} every time interval of {time} has a power of {power}.") } { let energy = Measure::::new(6.); let time = Measure::::new(2.); let power: Measure = energy / time; println!("A system generating or consuming the energy of {energy} every time interval of {time} has a power of {power}.") } { let energy = Measure::::new(6.); let time = Measure::::new(2.); let power: Measure = energy / time; println!("A system generating or consuming the energy of {energy} every time interval of {time} has a power of {power}.") } { let energy = Measure::::new(6.); let time = Measure::::new(2.); let power: Measure = energy / time; println!("A system generating or consuming the energy of {energy} every time interval of {time} has a power of {power}.") } { let force = Measure::::new(6.); let area = Measure::::new(2.); let pressure: Measure = force / area; println!("A force of {force} applied to an area of {area} exerts a pressure of {pressure}.") } { let force = Measure::::new(6.); let area = Measure::::new(2.); let pressure: Measure = force / area; println!("A force of {force} applied to an area of {area} exerts a pressure of {pressure}.") } { let force = Measure::::new(6.); let area = Measure::::new(2.); let pressure: Measure = force / area; println!("A force of {force} applied to an area of {area} exerts a pressure of {pressure}.") } { let energy = Measure::::new(6.); let mass = Measure::::new(2.); let specific_energy: Measure = energy / mass; println!("An energy of {energy} contained in a mass of {mass} has a specific energy of {specific_energy}.") } { let volume = Measure::::new(6.); let mass = Measure::::new(2.); let specific_volume: Measure = volume / mass; println!("A volume of {volume} containing a mass of {mass} has a specific volume of {specific_volume}.") } { let mass_density = Measure::::new(2.); let specific_volume: Measure = 1. / mass_density; println!("A mass density of {mass_density} is equivalent to a specific volume of {specific_volume}.") } { let mass = Measure::::new(6.); let area = Measure::::new(6.); let surface_density: Measure = mass / area; println!("A mass of {mass} distributed over an area of {area} has a surface density of {surface_density}.") } { let energy = Measure::::new(6.); let area = Measure::::new(6.); let surface_tension: Measure = energy / area; println!("An energy of {energy} distributed over an area of {area} has a surface tension of {surface_tension}.") } { let force = Measure2d::::new(6., 2.); let arm = Measure2d::::new(1., 4.); let torque: Measure = force.cross_product(arm); println!("If some object constrained to rotate around an axis receives a force of {force} laying in the plane orthogonal to the axis, applied at a position from the rotation axis of {arm}, that causes a torque (a.k.a. moment of force) of {torque}.") } { let force = Measure3d::::new(6., 2., -3.); let arm = Measure3d::::new(1., 4., 6.); let torque: Measure3d = force.cross_product(arm); println!("If some object constrained to rotate around a point receives a force of {force}, applied at a position from the rotation point of {arm}, that causes a torque (a.k.a. moment of force) of {torque}.") } { let force = Measure2d::::new(6., 2.); let arm = Measure2d::::new(1., 4.); let torque: Measure = force.cross_product(arm); println!("If some object constrained to rotate around an axis receives a force of {force} laying in the plane orthogonal to the axis, applied at a position from the rotation axis of {arm}, that causes a torque (a.k.a. moment of force) of {torque}.") } { let force = Measure3d::::new(6., 2., -3.); let arm = Measure3d::::new(1., 4., 6.); let torque: Measure3d = force.cross_product(arm); println!("If some object constrained to rotate around a point receives a force of {force}, applied at a position from the rotation point of {arm}, that causes a torque (a.k.a. moment of force) of {torque}.") } { let force = Measure2d::::new(6., 2.); let arm = Measure2d::::new(1., 4.); let torque: Measure = force.cross_product(arm); println!("If some object constrained to rotate around an axis receives a force of {force} laying in the plane orthogonal to the axis, applied at a position from the rotation axis of {arm}, that causes a torque (a.k.a. moment of force) of {torque}.") } { let force = Measure3d::::new(6., 2., -3.); let arm = Measure3d::::new(1., 4., 6.); let torque: Measure3d = force.cross_product(arm); println!("If some object constrained to rotate around a point receives a force of {force}, applied at a position from the rotation point of {arm}, that causes a torque (a.k.a. moment of force) of {torque}.") } println!(); } fn print_all_thermodynamics_mixed_operations() { println!("* Thermodynamics mixed operations"); // TODO Entropy == Energy / Temperature // TODO SpecificHeatCapacity == Entropy / Mass // TODO ThermalConductivity == Power / Length / Temperature println!(); } fn print_all_chemistry_mixed_operations() { println!("* Chemistry mixed operations"); //TODO println!(); } fn print_all_radioactivity_mixed_operations() { println!("* Radioactivity mixed operations"); //TODO println!(); } fn print_all_optics_mixed_operations() { println!("* Optics mixed operations"); //TODO println!(); } fn print_all_electricity_mixed_operations() { println!("* Electricity mixed operations"); //TODO println!(); } fn print_all_magnetism_mixed_operations() { println!("* Magnetism mixed operations"); //TODO println!(); } fn print_all_other_mixed_operations() { println!("* Other mixed operations"); //TODO println!(); } fn print_all_mixed_operation() { print_all_computer_science_mixed_operations(); print_all_geometry_mixed_operations(); print_all_kinematics_mixed_operations(); print_all_dynamics_mixed_operations(); print_all_thermodynamics_mixed_operations(); print_all_chemistry_mixed_operations(); print_all_radioactivity_mixed_operations(); print_all_optics_mixed_operations(); print_all_electricity_mixed_operations(); print_all_magnetism_mixed_operations(); print_all_other_mixed_operations(); } fn print_all_transformations() { // TODO } fn main() { println!("*** full ***"); print_all_units(); print_all_single_unit_operations(); print_all_mixed_operation(); print_all_transformations(); }