Questions tagged [physics]

Refers to real-world physics. For simulation of physics in games use the [game-physics] tag instead, for questions using an existing physics engine use [physics-engine]. Physics is a science that studies the interactions of energy and matter. Questions with this tag concern the simulation or implementation of real-world physics concepts in programming.

The physics tag should be used for questions about how physics can be simulated or implemented in programming. Please ask questions about physics in a non-programming context on the Physics site. Also consider that questions specific to a simplified or approximate physics engine for use in games might receive better answers if asked on Game Development.

3476 questions
12
votes
3 answers

The physics of turning in a boat

I am writing a small simulation of a boat (a sailboat under power rather than sail). It has a rudder and a keel and I have most of the physics working for the thrust and drag. I have modelled the drag across the boat to be higher than along the…
Magic Bullet Dave
  • 9,006
  • 10
  • 51
  • 81
12
votes
3 answers

Vector direction for gravity in a circular orbit

I am currently working on a project in C# where i play around with planetary gravitation, which i know is a hardcore topic to graps to it's fullest but i like challenges. I've been reading up on Newtons laws and Keplers Laws, but one thing i cannot…
Casper Bang
  • 793
  • 2
  • 6
  • 24
12
votes
6 answers

2d trajectory planning of a spaceship with physics

I'm implementing a 2D game with ships in space. In order to do it, I'm using LÖVE, which wraps Box2D with Lua. But I believe that my question can be answered by anyone with a greater understanding of physics than myself - so pseudo code is accepted…
kikito
  • 51,734
  • 32
  • 149
  • 189
12
votes
3 answers

Unity 2d jumping script

Does anyone have a good jumping script for 2d games in unity? The code I have works but still is far from jumping, it looks like it is flying. using UnityEngine; using System.Collections; public class movingplayer : MonoBehaviour { public Vector2…
user3189504
  • 161
  • 1
  • 1
  • 12
12
votes
2 answers

Calculate gravity with inclometer

How would one convert an inclinometers (Pitch, Yaw and Roll) into the gravitational pull expected on the system in [X,Y,Z]? A system at rest in a certain Pitch, Yaw and Roll angle should be pulled to earth at a certain [X*g,Y*g,Z*g], lets say this…
Thomas Andreè Wang
  • 3,379
  • 6
  • 37
  • 53
12
votes
7 answers

Good book for Monte Carlo methods in c++?

Can anybody recommend a good introduction book on Monte Carlo algorithms in c++? Preferably with applications to physics, and even more preferably, the kind of physics being quantum mechanics. Thanks!
trolle3000
  • 1,067
  • 2
  • 14
  • 27
11
votes
1 answer

Best book for learning sensor fusion, specifically regarding IMU and GPS integration

I have a requirement of building an Inertial Measurement Unit (IMU) from the following sensors: Accelerometer Gyroscope Magnetometer I must integrate this data to derive the attitude of the sensor platform and the external forces involved (eg.…
James
  • 2,458
  • 3
  • 26
  • 50
11
votes
7 answers

What exactly does the iPhone accelerometer measure?

The apple documentation for UIAcceleration class says, "When a device is laying still with its back on a horizontal surface, each acceleration event has approximately the following values: x: 0 y: 0 z: -1" Now, I am confused! How can the…
gigahari
  • 671
  • 1
  • 7
  • 19
11
votes
2 answers

Damping Effect of Spring-Mass System (or is this ElasticEase?)

I'm trying to emulate an animation effect in code (almost any language would do as it appears to be math rather than language). Essentially, it is the emulation of a mass-spring system. I've been looking at WPF/Silverlight's ElasticEase and this…
Todd Main
  • 28,951
  • 11
  • 82
  • 146
11
votes
6 answers

Libraries for converting physical units (kilograms, pounds) in Ruby?

I know Rails has some nice helpers for date and time management. Is there an already-working project consisting of, or incorporating a clean DSL for standard units and their conversions? Any project with helpers for the conversion between the two…
Joseph Weissman
  • 5,697
  • 5
  • 46
  • 75
11
votes
10 answers

What's the best language for physics modeling?

I've been out of the modeling biz, so to speak, for a while now. When I was in college, most of the models I worked with were written in FORTRAN, which I never liked. I'm looking to get back into science, so I'm wondering if there are modern…
FCBastiat
  • 119
  • 1
  • 1
  • 4
11
votes
1 answer

Algorithm to animate a page flip in 3D?

I would like to make a realisticly looking page flip animation. It does not have to be a true physical model, as long as it looks convincing. Many shops have flash animations of their real-world brochures but I don't find them convincing. The page…
user180326
11
votes
9 answers

How do I apply gravity to my bouncing ball application?

I've written a fairly simple java application that allows you to drag your mouse and based on the length of the mouse drag you did, it will shoot a ball in that direction, bouncing off walls as it goes. Here is a quick screenshot: alt text…
anon
11
votes
5 answers

Generator of evenly spaced points in a circle in python

I am tasked with generating evenly (more or less) spaced points on concentric rings of an invisible circle. The function should take a list of radii, and number of points to plot for a given radius as arguments. For example for a radius of 0 it…
Oli Ryan
  • 171
  • 1
  • 1
  • 5
11
votes
3 answers

Finding a stable placement of an irregular (non-convex) shape

Given an image of a 2-dimensional irregular (non-convex) shape, how would I able to compute all the ways in which it could lie stable on a flat surface? For example, if the shape is a perfect square rectangle, then it will surely have 4 ways in…
Hao Wooi Lim
  • 3,928
  • 4
  • 29
  • 35