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
1
vote
1 answer

does libGDX box2dDebugRenderer renders ray?

I am using libGDX for hobby Game Development,I am using two stages one is for graphics and one is for box2d world with debugDraw, every box2d fixtures debugDraw well with their graphics but I cant debugDraw a raycast!, how can I easily achieve…
1
vote
1 answer

Bullet Physics Problems

For those of you who have used bullet physics... I read and ran the hello world example http://www.bulletphysics.org/mediawiki-1.5.8/index.php/Hello_World, and I am confused where to go next. The hello world tutorial consisted of a…
user434565
  • 909
  • 1
  • 10
  • 21
1
vote
2 answers

How can I rotate a Box2D body without applying a force to it?

Anyone know? All I can see is ApplyTorque and SetAngularVelocity, I want to just rotate the object before adding it to the simulation, for example: so I have one crate tilted up against a wall and another flat.
Scott
  • 13
  • 3
1
vote
1 answer

Cuda math vs C++ math

I implemented the same algorithm on CPU using C++ and on GPU using CUDA. In this algorithm I have to solve an integral numerically, since there are no analytic answer to it. The function I have to integrate is a weird polynomial of a curve and at…
Feynstein
  • 31
  • 7
1
vote
1 answer

Unity3d: Backspin of Sphere with Rigidbody

I am by any means not a physics expert, hence I can't really tell how the effect I am looking for is called. I'll just call it "Backspin" for now :) Picture this scenario: There is a ping pong ball in front of you on a ping pong table. You put…
user2669261
  • 396
  • 1
  • 5
  • 18
1
vote
1 answer

Three-body p‌r‌o‌b‌l‌e‌m (Burrau's pythagorean p‌r‌o‌b‌l‌e‌m.) with Runge-Kutta 4 integration method (c language)

I'm trying to solve the Three-body problem known as Burrau's pythagorean problem (initial conditions m1=3, m2=4, m3=5, x1 = 1, y1 = 3, x2 = -2, y2 = -1, x3 = 1, y3 = -1) with the Runge-Kutta 4 method to solve the differential equations, but when I…
tnnm95
  • 13
  • 3
1
vote
1 answer

How to get an angle for a projectile such that it will hit a vector 2 target while factoring in gravity

I have an enemy that can shoot projectiles, but my issue is I am trying to find the angle required to hit the player, but the projectile has to be shot at an exact velocity (i.e can't shoot the projectile more slowly). I have tried the range…
1
vote
0 answers

ImageJ nanotubes detection and extraction

I have an image of a layer of carbon nanotubes taken with an electronic microscope and I would like to extract the "shape" of every nanotube. I think that ImageJ could be very helpful since it has already led me to encouraging results, but I am…
Frowl
  • 11
  • 3
1
vote
2 answers

Merging three functions into one

I'm building a program that converts orbital elements into cartesian coordinates. I want to create a function that does this, converts orbital elements into cartisian coordinates, but I can't get it to work. This is my first time using fortran so…
1
vote
1 answer

Create a ring body in PhysicsJS

I am currently working on a project that requires a circular ring shaped body. How can I achieve this? I have tried to use a the convex-polygon body with vertices similar to those of a circle but I am getting a The vertices specified do not match…
FlamingPickle
  • 199
  • 1
  • 3
  • 14
1
vote
2 answers

Box2D How to stop Player (Box) from rotating

So I have a player (Box2D box) that can be moved horizontally with 'A' and 'D' using: SetLinearVelocity(b2Vec2(speed, object.getB2Object()->GetLinearVelocity().y)); But when I move the box the player doesn't slide but roles on the corners like…
MajesticHey
  • 128
  • 8
1
vote
1 answer

Android - how do i animate a shape?

I need a little start-up aid. I want to animate a circle, that is 'flying' vertically, when the user swipes crabwise. What do i have to do, after creating a circle on a canvas? Bitmap bg = Bitmap.createBitmap(480, 800, Bitmap.Config.ARGB_8888);…
jle
  • 686
  • 1
  • 8
  • 24
1
vote
1 answer

Animating a Projectile's Trajectory Python

I'm working on learning python more in depth than from my previous questions now that my internship is over and I hit an issue I'm using a book "Doing Math With Python" by Amit Saha which what I decided to jump to was 'Animating a Projectile's…
1
vote
2 answers

IndexError: too many indices for array - Total Energy Matrix Variational Method

I'm trying to define an array for total energy (H) where the following relationship is true: < i | H | j > = E_j < i | j > = E_j * S[ i , j ] and S[ i , j ] is the corresponding element of the overlap matrix. I have the matrix E_j and I am trying…
XBB
  • 109
  • 1
  • 13
1
vote
0 answers

Difficulty using scipy.integrate.odeint to solve radial wave function of hydrogen

I'm trying to use scipy.integrate.odeint to solve for the wavefunction of an atom of hydrogen, but it doesn't seem to give the correct form of solution. Here is the function that should be implementing the SE equation. def eq(y,r,l,E_nl): [u_nl,…
Zachary Hawkhead
  • 75
  • 1
  • 1
  • 5