Physics
Kinematics Simulator
Last update: 01/19/09 (Latest release and source code.)
This project aims to simulate real world physics of simple objects using Newtonian laws of mechanics in two dimensions. Computational mathematics involved in these simulations is distributed through carefully designed class hierarchy. Kinematics is written in Visual Basic 2005 Express Edition (.NET platform) utilizing DirectX (Draw) technology. Newton's Laws of Motion are simulated in the collision mode and Universal Law of Gravitation in gravitational mode.
Collision mode simulates motion of four point masses. The vectors of velocity and acceleration are drawn in blue and green colors respectively. The point masses bounce off the screen borders. Objects also lose kinetic energy due to collisions with screen borders and with each other (coefficient of restitution can be changed manually in the source code.)
Gravitational loop of Kinematics simulates motion of two point masses when gravitational force is significant enough to affect their trajectories. Even though internal gravitational constant does not correspond to real world value, the simulator shows that elliptical trajectories (observed by Kepler and predicted by Newton) are indeed a product of gravitational interaction. It is also possible to disable the centering of the screen on a point mass to observe the trajectories with respect to the origin of coordinates.
In the future, this program will simulate more of the real world physics, including torque, friction and complex geometric shapes.
Diffraction and Fourier Transform
Needless to say, phenomenon of diffraction and Fourier transform have central importance in modern natural sciences. The fact that light forms diffraction pattern has revolutionized physics and forever changed our understanding of light. Fourier transform is a mathematical technique that is used in signal processing. In essence, diffraction pattern produced by a light source can be simulated by Fourier transform.
You can download my 2D discrete fast Fourier transform implementation in Visual Basic NET 2005 with source code.
Sound Synthesis
It is widely known that hearing is an act of perceiving variation in air pressure as sound. When a digital receiver acquires audio signal, it samples the pressure and transforms it into a series of values corresponding to the amplitude of the wave at a particular moment in time. These values form arrays that are subsequently recorded on storage devices. Thus, if a programmer is able to obtain full access to the original array of amplitude values, it will become possible to modify them and create completely arbitrary sound effects or simply novel sounds. The source code provided below allows you to do just that. In fact, it illustrates how easy it is to create a basic sound algorithmically.
cWavProcessor is a Visual Basic 6 class which enables a programmer to modify a wav file (16 bit) at a sample (amplitude) level.
Carnot Cycle
Carnot Cycle Designer is a Visual Basic 6 program that draws the Carnot cycle with various parameters specified by the user.