Maybe CalcPad needs more examples to give people an idea what it is, since so 
far the only feedback on my beta is a recommendation for a competing project 
(which is neither RB nor open-source!).  Andy presents a good starting point:

> The ultimate product in calculation and unit conversion is Frink  
> (Java based non-open-source)
>...
> and vastly more important and trivial conversions
> 
> eg; if you were going to the Sun in a spaceship that travelled at one  
> lightyear/hour how long would it take?
> 
> 93 million miles / (1 lightyear / s) -> milliseconds
> 
> 56.952089773784459871

This is an incomplete result, in my opinion, because it doesn't include the 
units -- granted, they're implied by the input, but that doesn't help if you 
want to use the output in a subsequent calculation.  In CalcPad, this would be:

 unit lightyear = 9460528404879 km
 unit msec = 0.001 sec
 93*10^6 mile / (1 lightyear/hr) in msec: 56.953306 msec

(You type only what's before the colon; the colon and result is added by 
CalcPad.)  Note that this is copied straight from CalcPad; you must have 
retyped your example, since you say lightyear/s but the result is only right if 
you actually used lightyear/hr.  Anyway, suppose you now wanted to see how much 
energy this trip to the sun would take, if your ship's power plant burns 1.21 
GW:

 # * 1.21 GW: 68913500.520306 J

"#" is a special symbol which means "the result on the last line."  The 
calculation here works only because all results include the units.  This is 
true also when you assign variables:

 use km, sec, kJ, GW   -- define what units we like to see: 
 shipSpeed = 1 lightyear/hr: 2627924556.910833 km / sec
 tripDist = 93*10^6 mile: 149668992 km
 tripTime = tripDist / shipSpeed: 0.056953 sec
 shipPower = 1.21 GW: 1.21 GW
 tripEnergy = tripTime * shipPower: 68913.50052 kJ

You can define and use functions, too, like this:

 -- assume that each J of power costs us 1 cent
 tripCost(dist) = dist / shipSpeed * shipPower * (0.01 $/J)
 -- trip to the sun costs...
 tripCost( 93*10^6 mile ): 689135.005203 $
 -- trip to Alpha Centauri costs...
 tripCost( 4 lightyear ): 174240000000 $

Finally, to get our ship speed in furlongs per fortnight, we have to define 
those units -- out of the box, CalcPad has just the common units.  Perhaps some 
beta tester would like to request other ones?  But no matter, it's easy to do:

 furlong = 201.168 m
 fortnight = 14 day
 shipSpeed in furlong, fortnight: 15801407500394416 furlong / fortnight

So there are some examples.  CalcPad not a primarily unit converter, but a 
full-fledged worksheet-style calculator that happens to work with fully defined 
quantities.  (My wife uses CalcPad extensively, and doesn't ever use units at 
all -- she's a computer scientist!)

Does this inspire anyone to actually try my open-source REALbasic app, and give 
me some feedback?  :)    <http://www.codenautics.com/calcpad>

Thanks,
- Joe

--
Joe Strout -- [EMAIL PROTECTED]
Verified Express, LLC     "Making the Internet a Better Place"
http://www.verex.com/

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to