small fixes, bump minor

master
elfeiin 2024-05-04 00:58:40 -07:00
parent ec93a5e117
commit 78948af215
Signed by: elfein
GPG Key ID: A53FDD4FD091A276
6 changed files with 14 additions and 13 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "unidades"
version = "1.0.0"
version = "1.1.0"
edition = "2021"
[build-dependencies]

View File

@ -8,7 +8,7 @@ Type-safe units handling library. Do arithmetic on measurements. Convert between
#![feature(generic_const_exprs)]
use std::f64::consts::TAU;
use units::{
use unidades::{
dimensions::{
Energy,
Frequency,

View File

@ -70,7 +70,7 @@ fn gen_units_list() -> HashMap<[i8; 7], Dimension> {
("GalacticYear", (YEAR * 2.3e8, 0.0)),
("Age", (YEAR * (2148.0 + 1.0 / 3.0), 0.0)),
("Millenium", (YEAR * 1000.0, 0.0)),
("Centurie", (YEAR * 100.0, 0.0)),
("Century", (YEAR * 100.0, 0.0)),
("Jubilee", (YEAR * 50.0, 0.0)),
("Indiction", (YEAR * 15.0, 0.0)),
("Decade", (YEAR * 10.0, 0.0)),
@ -104,7 +104,7 @@ fn gen_units_list() -> HashMap<[i8; 7], Dimension> {
("Planck", (1.6e-35, 0.0)),
("Yard", (0.9144, 0.0)),
("Feet", (0.3048, 0.0)),
("Inche", (0.0254, 0.0)),
("Inch", (0.0254, 0.0)),
("Angstrom", (10e-10, 0.0))
],
},
@ -115,7 +115,7 @@ fn gen_units_list() -> HashMap<[i8; 7], Dimension> {
("SqMeter", (1.0, 0.0)),
("SqPlanck", (1.6e-35, 0.0)),
("SqYard", (0.9144, 0.0)),
("SqInche", (0.0254, 0.0)),
("SqInch", (0.0254, 0.0)),
("SqAngstrom", (1e-10, 0.0))
],
},

View File

@ -1,4 +1,4 @@
use units::{
use unidades::{
units::{
Feet,
Meter,

View File

@ -1,7 +1,7 @@
#![feature(generic_const_exprs)]
use std::f64::consts::TAU;
use units::{
use unidades::{
dimensions::{
Energy,
Frequency,

View File

@ -4,7 +4,7 @@ use std::{
f64::consts::PI,
f64::consts::TAU,
};
use units::{
use unidades::{
dimensions::{
Density,
Frequency,
@ -12,17 +12,18 @@ use units::{
Pressure,
Speed,
},
prefixes::{
Deci,
Mega,
},
units::{
self,
KgPerCubicMeter,
Meter,
MetersPerSecond,
Pascal,
Rpm,
},
prefixes::{
Deci,
Mega,
},
Unit,
};
@ -60,7 +61,7 @@ impl Flywheel {
pub fn max_velocity(&self) -> Speed {
Speed::new::<MetersPerSecond>(
((self.tensile_strength * 2.0 * self.thickness) / (self.density * PI.powf(2.0) * self.radius.square()))
.to_units::<units::units::MetersPerSecondPerSecond>()
.to_units::<units::MetersPerSecondPerSecond>()
.powf(0.5),
)
}