Implement calculations

This commit is contained in:
Gregory John Casamento 2019-10-08 05:05:39 -04:00
parent 884a146c1e
commit f56846b342

View file

@ -38,6 +38,9 @@
- (instancetype) init
{
self = [super init];
if (self != nil)
{
}
return self;
}
@ -115,6 +118,16 @@
{
return _constant;
}
- (double)baseUnitValueFromValue:(double)value
{
return ((_coefficient * value) + _constant);
}
- (double)valueFromBaseUnitValue:(double)baseUnitValue
{
return ((baseUnitValue / _coefficient) - _constant);
}
@end
// Abstract unit...