I am attempting to use output from an accelerometer moving back and forth on a single axis to calculate its current position.
I have tried using Euler integrations, but the velocity and position errors become too large too quickly. After some reading, I am wondering whether RK4 could be applied to this problem to minimise the error?
Ch...
i'm reading <<3D math primer for graphics and game development>>
By Fletcher Dunn and Ian Parberry, on page 170, the logarithm of quaternion is defined as
log q = log([cosa nsina])
≡ [0 an]
i don't see how does log([cosa nsina]) equals to [0 an], can anyone help me out?
thanks.
...
Hej guys,
I was wondering if you know any well working Math or Calculation engines written in Objective-C? Found a graphing one using CorePlot already....
Thanks for your help! :)
...
I'm trying to understand the math on this raphael.js demo:
http://raphaeljs.com/pie.js
Checkout the sector method:
function sector(cx, cy, r, startAngle, endAngle, params) {
var x1 = cx + r * Math.cos(-startAngle * rad),
x2 = cx + r * Math.cos(-endAngle * rad),
y1 = cy + r * Math.sin(-startAngle * rad),
y2 ...
Does anyone know a very simple physics engine, or just a set of basic functions that could complete these tasks: Simple point, line, and rectangle collision detection? I looked at Box2D but it is way too advanced for what I am making. I just need some simple code. Thanks in advance!
...
hi,
I have a large dataset with name and values. I want to categorize all these values into a meaningful category: eg: 25% names with certain range of values fall in category 1 50% names with certain range of values fall in category 2.
Tried using percentile calculation: but this ends up giving me inconsistent categorization. I was look...
I've have a 5 digit integer say,
int num = 23456
how to find the sum of the digits.???
...
How do you capture user input related to mathematical fractions. Assuming I would like to present a simple square and ask the user to select 3/4ths of a square. What kind of UI control should we use to first all represent a square (with 4 equal blocks inside) and to have a mechanism to capture user input.
Assuming you would like to draw...
As far as I known, there are are numpy and scipy for python.
Are there similar libs for F#?
Thanks.
...
Is there a library to render mathematical equations that can be used in iPhone OS?
I would be very happy with a library that renders MathML or LaTeX to a format that iPhone OS can display.
If the lib were licensed under BSD (or similar), that would be perfect.
...
Hi,
I got angle in degree as -415 degrees,
i have converted it into radian as
float degreeValue = -415
float radianValue = degreeValue * pi / 180.0;
here i got as -0.7(round off)
how to convert again into degree to get same value of angle in degrees.
...
I had an interesting job interview experience a while back. The question started really easy:
Q1: We have a bag containing numbers 1, 2, 3, …, 100. Each number appears exactly once, so there are 100 numbers. Now one number is randomly picked out of the bag. Find the missing number.
I've heard this interview question before, of cour...
Hi everybody,
We've all seen that stores have nice-looking pricing on their products; "1.99", "209.90" and so on.
That's easily done as well if you enter prices manually, but l et's say that we would have a database which stores prices, that are daily updated according to currency changes.
Prices are therefore automatically calculated...
what's the most elegant way of rounding a float to it's closest 1/4ths in Objective C?
For example:
3.14 should be 3.25
2.72 should be 2.75
6.62 should be 6.50
1.99 should be 2.00
etc.
...
I have been trying in vain to round down the current time to the lower hour in PHP.
Here's what I want to do:
1. Take the current time:
$time_now = time();
2. Round it down to the closest hour:
$time_now = $time_now - ($time_now % 3600);
3. Print it using the function date:
print date('d m Y H:i', $time_test);
But what seems to be happ...
Hi,
I see 2 implementations of sparse matrix in this package.
OpenMapRealMatrix
SparseFieldMatrix
Both are documented as "Sparse matrix implementation based on an open addressed map".
Do you know what are the diffrences between the two? also, what's the best way to iterate over all entries in a fast way (which means, iterating over...
in c#, at least, generating a new guid is a one line one call process.
A guid is easy to use and format, and it "guarantees" uniqueness.
However, is it irresponsible to just go off and generate new guids for every little thing. Could we be significantly increasing the chances of a "ta tan tan" guid collision?!
thoughts...?
...
Hi,
I think this is not really possible but worth asking anyway. Say I have two small numbers (Each ranges from 0 to 11). Is there a way that I can compress them into one byte and get them back later. How about with four numbers of similar sizes.
What I need is something like: a1 + a2 = x. I only know x and from that get a1, a2
For the...
Thanks to some very helpful stackOverflow users at Bit twiddling: which bit is set?, I have constructed my function (posted at the end of the question).
Any suggestions -- even small suggestions -- would be appreciated. Hopefully it will make my code better, but at the least it should teach me something. :)
Overview
This function wil...
How to get the co-ordinates of the outline shape formed using smaller grid blocks.
For example, If I used 32x32 unit blocks for construct a shape (any shape).
Then how can I get overall co-ordinates of the shape, including the negative spaces.
For example:
One could arrange the blocks like this:
(each block is 32x32 and coordinates ref...