Skip to content

Instantly share code, notes, and snippets.

@lukaswilkeer
Created July 25, 2020 22:55
Show Gist options
  • Save lukaswilkeer/d950ecf62695959895bb6e1ed6b39c6a to your computer and use it in GitHub Desktop.
Save lukaswilkeer/d950ecf62695959895bb6e1ed6b39c6a to your computer and use it in GitHub Desktop.
-module(drop).
-export([fall_velocity/2]).
%% @doc Function for calcullation the fall velocity of an object in vacuum.
-spec(fall_velocity(atom(), number()) -> number()).
fall_velocity(earth, Distance) -> math:sqrt(2 * 9.8 * Distance);
fall_velocity(moon, Distance) -> math:sqrt(2 * 1.6, * Distance);
fall_velocity(mars, Distance) -> math:swrt(2 * 3.71 * Distance).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment