physics

R Generating a 1 min spaced time sequence

匆匆过客 提交于 2020-01-01 14:33:54
问题 I would like to generate a 1 min spaced time sequence to paste then to a xts object. Basically, I've got a tick-by-tick dateTime object like that : [1] "2010-02-02 08:00:03 CET" "2010-02-02 08:00:04 CET" "2010-02-02 08:00:04 CET" "2010-02-02 08:00:04 CET" "2010-02-02 08:00:04 CET" [6] "2010-02-02 08:00:04 CET" "2010-02-02 08:00:04 CET" "2010-02-02 08:00:05 CET" "2010-02-02 08:00:05 CET" "2010-02-02 08:00:05 CET" I'm aggregating my xts series (by previous tick) to get a 1 min (equally)-spaced

Trying to simulate a 1-dimensional wave

南笙酒味 提交于 2020-01-01 09:42:32
问题 I'm trying to make a simplified simulation of a 1-dimensional wave with a chain of harmonic oscillators. The differential equation for the position x[i] of the i-th oscillator (assuming equilibrium at x[i]=0 ) turns out to be - according to textbooks - this one: m*x[i]''=-k(2*x[i]-x[i-1]-x[i+1]) (the derivative is wrt the time) so i tried to numerically compute the dynamics with the following algorithm. Here osc[i] is the i-th oscillator as an object with attributes loc (absolute location),

Trying to simulate a 1-dimensional wave

徘徊边缘 提交于 2020-01-01 09:41:09
问题 I'm trying to make a simplified simulation of a 1-dimensional wave with a chain of harmonic oscillators. The differential equation for the position x[i] of the i-th oscillator (assuming equilibrium at x[i]=0 ) turns out to be - according to textbooks - this one: m*x[i]''=-k(2*x[i]-x[i-1]-x[i+1]) (the derivative is wrt the time) so i tried to numerically compute the dynamics with the following algorithm. Here osc[i] is the i-th oscillator as an object with attributes loc (absolute location),

Simulating refraction in SceneKit

不想你离开。 提交于 2020-01-01 09:38:07
问题 I am trying to create an ios 9 app for a project which will visualise 3d scenes with these special kind of theoretical lenses called glenses. A ray tracing program called TIM has already been written from the ground up for simulating these glenses and more, but it's infeasable to simply port this to ios. My understanding from searching the site (i.e. this answer and many others on shaders) is that it should be possible but I'm having a hard time getting the desired effect. I decided that I

Suggestions for .Net 3D physics engine [closed]

梦想与她 提交于 2020-01-01 09:01:54
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I need physics engine to simulate game world on server. I googled for .Net physics engines and they all were released in 2006-2009. So

How do I check if a simplex contains the origin?

99封情书 提交于 2020-01-01 05:03:30
问题 I am implementing the Gilbert-Johnson-Keerthi algorithm which computes whether two objects are intersecting (ie. colliding). The entry point to my code is the hasCollided function which takes two lists of points and returns True if they are intersecting. I believe I have implemented the paper correctly - however, I still have to implement the contains function. The contains function should determine whether a simplex contains the origin. I am unsure as to how to implement this. How do I

how to calculate a negative acceleration?

孤街醉人 提交于 2020-01-01 02:42:05
问题 I'm implementing the scrolling behaviour of a touch screen UI but I'm too tired in the moment to wrap my mind around some supposedly trivial piece of math: y (distance/velocity) |******** | ****** | **** | *** | *** | ** | ** | * | * -------------------------------- x (time) f(x)->? The UI is supposed to allow the user to drag and "throw" a view in any direction and to keep it scrolling for a while even after he releases the finger from the screen. It's sort of having a momentum that depends

Algorithm to control acceleration until a position is reached

大兔子大兔子 提交于 2019-12-31 10:37:06
问题 I have a point that moves (in one dimension), and I need it to move smoothly. So I think that it's velocity has to be a continuous function and I need to control the acceleration and then calculate it's velocity and position. The algorithm doesn't seem something obvious to me, but I guess this must be a common problem, I just can't find the solution. Notes: The final destination of the object may change while it's moving and the movement needs to be smooth anyway. I guess that a naive

Implementing gravity in simple 2d game

最后都变了- 提交于 2019-12-30 11:34:33
问题 I'm making a simple game, something like mario, with a character fixed in one position, and the ground moving left, giving the illusion of character movement. The ground is made of rectangular blocks defined by top-left and bottom-right coordinates: private int surfaceMatrix[][] = { {0, 100, 300, 0} // block having 100 height and 300 width }; Jumping is just changing character's y coordinate while moving the surface left, so the jump looks like reversed V letter. The rest of the code -

Separating Axis Theorem and Python

百般思念 提交于 2019-12-30 06:56:30
问题 This is what I am currently doing: Creating 4 axis that are perpendicular to 4 edges of 2 rectangles. Since they are rectangles I do not need to generate an axis (normal) per edge. I then loop over my 4 axes. So for each axis: I get the projection of every corner of a rectangle on to the axis. There are 2 lists (arrays) containing those projections. One for each rectangle. I then get the dot product of each projection and the axis. This returns a scalar value that can be used to to determine