summaryrefslogtreecommitdiff
path: root/1958/CH2/EX2.4/Chapter2_example4.sce
blob: 8989a81b20869b010ce2aaebf0af1d1249539f7e (plain)
1
2
3
4
5
6
7
8
9
10
11
clc
clear
//Input data
m=0.05//Mass of the body in kg
v=[3,5]//Velocity in vector form 3i+4j in m/s

//Calculations
ke=(1/2)*m*(v(1)^2+v(2)^2)//Kinetic energy in J

//Output
printf('Kinetic energy is %3.2f J',ke)