Difference between revisions of "ZCubes/How to Apply Universal Constants and Unit Conversions"

From ZCubes Wiki
Jump to navigation Jump to search
Line 7: Line 7:
 
{{#ev:youtube|DyXY6snQSQk|480|left|Universal Constants and Unit Conversions}}
 
{{#ev:youtube|DyXY6snQSQk|480|left|Universal Constants and Unit Conversions}}
 
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
 
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
 +
 +
==Examples==
 +
Universal constants that are pre-defined in ZCubes can be used in functions by using '%' symbol before the constant parameter.
 +
 +
E.g 1] To calculate the Energy 'E', the universal constant value of speed of light can be used directly in ZCubes as:
 +
 +
</br>
 +
<math>E := m*%c^2;</math>
 +
</br>
 +
<math>E(2)</math>
 +
 +
displays the result as ''179751035747363520''.
 +
 +
 +
E.g 2] To calculate the Force 'F', the gravitational constant can be used in ZCubes as:
 +
 +
</br>
 +
<math>F := m*%g;</math>
 +
</br>
 +
<math>F(2)</math>
 +
 +
displays the result as ''19.6133''.
 +
 +
 +
E.g 3] To calculate the Energy 'E'and display it using appropriate unit, the ZCubes code can be written as:
 +
 +
</br>
 +
<math>E := m*%c^2;</math>
 +
</br>
 +
<math>E(2kg)<>J</math>  ..'J(Joule)' is the MKS unit of Energy
 +
 +
displays the result as ''179751035747363520J''.
  
  

Revision as of 03:50, 12 March 2020

How to Apply Universal Constants and Unit Conversions


All the Universal constants or Physical/Chemical constants such as ‘Gravitational constant’, ‘Speed of light’, ‘Avogadro’s number’ etc are available in ZCubes in a way they can be used in functions. This video demonstrates how to use these constants in Z programming or spreadsheet computations using easy notations. ZCubes handles computations with ‘Units’ which is extremely useful in scientific computations.

Video


Universal Constants and Unit Conversions














Examples

Universal constants that are pre-defined in ZCubes can be used in functions by using '%' symbol before the constant parameter.

E.g 1] To calculate the Energy 'E', the universal constant value of speed of light can be used directly in ZCubes as:



displays the result as 179751035747363520.


E.g 2] To calculate the Force 'F', the gravitational constant can be used in ZCubes as:



displays the result as 19.6133.


E.g 3] To calculate the Energy 'E'and display it using appropriate unit, the ZCubes code can be written as:



..'J(Joule)' is the MKS unit of Energy

displays the result as 179751035747363520J.


<< Learn ZCubes
© Copyright 1996-2020, ZCubes, Inc.