physics

Simple 2D rocket dynamics

I am currently experimenting with some physics toys in XNA using the Farseer Physics library, however my question isn't specific to XNA or Farseer - but to any 2D physics library. I would like to add "rocket"-like movement (I say rocket-like in the sense that it doesn't have to be a rocket - it could be a plane or a boat on the water or...

Optimizing an inner loop calculation in Mathematica

Hi all, I'm currently doing some computation in Mathematica related to Quantum Mechanics. As we've moved from a 1D to 2D lattice model, the problem size is becoming problematic Currently, we have a summation that looks something like this: corr[r1_, r2_, i_, j_] = Sum[Cos[f[x1, x2] Angle[i] r1 + f[y1, y2] Angle[j] r2], {x1, HL}, {x2, H...

How do I implement multiple sources of gravity, specifically the trig required. (C#) VS 2010

Hi guys. I am designing a small game wherein objects are attracted by multiple objects at once. What I am doing is plotting the course that the shots of these objects will take. To calculate the pull of the planets, I am using this formula: gravityStr/distToTarg^2 (pseudo code). Where my problem lies is in calculating the direction (an...

Actionscript collisions: solving exceptions and strange cases

I have created a collision class to detect collisions using pixels. In my class I've also developed some functions for determining the collsion angle. Based on this I created some examples: http://megaswf.com/serve/25437/ http://megaswf.com/serve/25436/ (Space to change gravity, right/left to give some speed to the ball.) As you will...

Any library for basic science chemistry/physics programming?

I am wondering if there is an open source scientific library for chemistry and/or physics for C++ (or maybe C)? I am NOT looking for simulation models, visualization, 3-d modeling. I am just looking for a basic toolbox that would have, for example: various constants such as Ideal Gas Constant, Avogadro constant, periodic table of the ...

Non-Rigid Body 2D Physics Engines in C++

Hey, I'm trying to experiment with 2D physics engines in C++. So far, it seems the most popular is Box2D. Unfortunately, Box2D is a rigid body physics engine and that's not really going to help me with what I want to try. I want to be able to define a shape which has a number of vertices joined by springs, such that when this shape col...

Android::Creating a draggable elastic ball?

I created a custom view loading an image of a small ball. So that the onDraw method would look like this: public void onDraw(Canvas canvas) { canvas.drawBitmap(...); } Later, I added an onTouch listener to be able to listen to touch events to enable the ball to be dragged around. public boolean onTouchEvent(MotionEvent event) { ...

Character lurches when moving as if snapping into grid?

http://davzy.com/gameA/ is the URL to a test of what I was doing, all my code is there too. I want the movement of the blue box to be fluid, not so lurchy as if it's snapping into a grid, but I want him to be moving very fast. I'm not sure how to accomplish this. I wrote a gameSpeed variable but when increasing it the movement of the b...

Why does my my gravity work in this?

http://davzy.com/gameA/ I can't figure out a smart way to get gravity. Now with this it detects which block the character is over but it does't drop to that block! Is there a better way to do gravity? I'd like to do this without a game library. ...

Are there Research Areas which combine Computer Science with Physics or Space Technology? If yes, please give details.

Throughout my high school i loved physics very very much. I always wanted to a PhD in physics. Along with i thought of pursuing space science. But due certain reasons i ended up in Computer Science. I have started with the third year of my bachelors degree. I don't hate computer Science, it's just that i loved physics a lot(I dunno about...

Chipmunk: How to remove shape and body?

First, sorry for my English, im not an American. My question is how can I remove the shape and body from the space, this isn't related with collision detection. Im triying to do this with a touch event, specifically I'm trying to clear a ball Touching it (I have a lot of balls in the space), but I have no idea how to do it, I have been l...

Diminishing speed in zero gravity box2d world

I am trying to create a dynamic body that orbits around a static body in Box2D. I have a zero-gravity world, and a DistanceJoint that connects the two bodies. I have removed all friction and damping from the bodies and the joint, and am applying an initial linear velocity to the dynamic body. The result is that the body starts orbiting, ...

How to draw a moving laser beam?

I'm looking to draw a laser beam which can possibly bounce around a box. Basically the laser beam is of variable length and when it bounces off a surface it will reflect at the angle that it collides. I can handle the collision stuff myself (probably, haven't tried it yet though), but I'm confused about how the actual drawing would work...

Change direction of a moving object....(pure physic question)

Hi, This is a pure physic question but i don't know why it doesn't work....i have a moving object.i get the value of vcos(theta) and vsin(theta)...from this i calculate the velocity and angle of motion.....also i know another point (x,y) and want to direct the object to this point.I think i need to apply a certain force(force must hav...

Box2D and sonic-like physics for platformer

I'm working on a platformer for the iPhone that is using Box2D and cocos2D. I'm trying to figure out a way to create similar behavior for my controlled character as is found in the Sonic the Hedgehog games, but maintain use of the Box2D physics library as I want projectiles and some level objects to behave according to realistic physics...

Applying scrolling physics to an app

Hi all, I believe this is a fairly simple question but I have no idea where to start. I'm trying to implement a feature where an entity (such as an image) can be flicked across the screen such that it decelerates over time based on an initial speed (non-zero) and coefficient of friction. In other words, given an initial velocity and c...

Neural Network size for Animation system

I decided to go with a Neural Network in order to create behaviors for an animation engine that I have. The neural network takes in 3 vector3s and 1 Euler angle for every body part that I have. The first vector3 is the position, the second is its velocity, and the third is its angular velocity. The Euler angle is what rotation the body p...

iPhone - Bike physics game

I want to make a game where you ride a bicycle down a hill - using accelerometer for rider tilt and a pedal/brake button (vaguely like Moto X Meyhem). Does any one have any ideas where i can find tutorials/documentation of the things that i would have to do. (don't know where to start) I guess what i need is: To simulate physics of the...

Box2d - Bike Game - Terrain

I'm using Box2d for a Bike Physics Game, Box2d lets you have fixtures that are convex polygons with 8 points or less, would anyone know of an easier way have a complicated concave terrain, other that just making a whole bunch of fixtures? Or is than the only way? Any ideas, pointers, suggestions... Thanks in advance! (any language is OK...

Question on kinetic theory of gas (thermodynamics)

I have derived that, when there is a temperature difference (gradient) in a gas (consider a long tube with one end maintained at 100 degree and other end maintained at 0 degree), there will be a pressure gradient (something similar to Bernoulli's law). Please see the link for details: http://rejeev.blogspot.com/2010/07/pressure-and-tempe...