GithubHelp home page GithubHelp logo

gravity's Introduction

Test your knowledge of physics and C

This C program measures acceleration due to gravity.  When run without any arguments, it prints the exact value of g in SI units (m/s2).

Instructions: download the program text, save it to a file, compile and run it. It is very important that you preserve the formatting: if you delete or add a single newline, the program will not work!

#define O +\
__LI\
NE__\
,46-\
__LI\
NE__
char
g[]
={
46
O       O









        O

        O







        O







        O






        O



};main(   ){puts(g);}

To understand the program, print out the source and look at it from some distance.  The apparatus at the top is the particle dispenser; O's are falling particles, and at the bottom there's a photodector connected to a very precise timer.  The program works by measuring the time it takes for a particle to fall from the top of the program to the bottom.

You can reproduce Galileo's famous experiment by changing O to another letter and verifying that the value of acceleration doesn't change.

FIXME: current version of the program works only on Earth; support for other planets will be added in later revisions.  If you live on Mars and want to be a beta-tester, please contact me.

😉

gravity's People

Contributors

mishadynin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.