math

More complex view matrix calculation required to composite 3d models with 2d video

I'm utilising some 2d / 3d tracking data (provided by pfHoe) to help integrate some 3d models into the playback of some 2d video. Things are working.... okay... but there's still some visible 'slipping' of the models against the video background and I suspect this is may be because the XNA CreatePerspective helper method isn't taking in...

In software engineering, is it required you're good in math or physics there?

In what particular situation you will need a depth knowledge of math/physics in software engineering? ...

is it possible to write a program which prints its own source code utilizing a "sequence-generating-function"

is it possible to write a program which prints its own source code utilizing a "sequence-generating-function"? what i call a sequence-generating-function is simply a function which returns a value out of a specific interval (i.e. printable ascii-charecters (32-126)). the point now is, that this generated sequence should be the programs ...

How to maintain decimal precision in calculations

I need to sum 2 decimal values together, then divide by 2 and convert to string. My calculation currently is trimming to 2 decimal places, but I want to keep as many decimals as I can. city.Latitude = ( (lat.North + lat.South) / 2 ).ToString(); the values for lat.North and lat.South are like: 55.32342322 ...

Is a line formed by two points greater than 45 degrees off of the horzontal.

I am trying to find out if a line defined by two points is greater than or equal to 90 degrees compared to the horizontal. Here is the code I used bool moreThan90 = false; double angle = Math.Atan((double)(EndingLocation.Y - Location.Y) / (double)(EndingLocation.X - Location.X)); if (angle >= Math.PI / 2.0 || angle <= -Math.PI / 2.0) ...

An implementation of Sharir's or Aurenhammer's deterministic algorithm for calculating the intersection/union of 'N' circles

The problem of finding the intersection/union of 'N' discs/circles on a flat plane was first proposed by M. I. Shamos in his 1978 thesis: Shamos, M. I. “Computational Geometry” Ph.D. thesis, Yale Univ., New Haven, CT 1978. Since then, in 1985, Micha Sharir presented an O(n log2n) time and O(n) space deterministic algorithm for the disc...

How to parse math expressions in C#?

Possible Duplicate: Is there a string math evaluator in .NET? Can C# parse mathematical expressions such as y=3*x + 3 into string? If so, ho? I appreciate your help. ...

What is the best practice when coding math class/functions ?

Introductory note : I voluntarily chose a wide subject. You know that quote about learning a cat to fish, that's it. I don't need an answer to my question, I need an explanation and advice. I know you guys are good at this ;) Hi guys, I'm currently implementing some algorithms into an existing program. Long story short, I created a ...

C# Math calculator

Possible Duplicates: Is there a string math evaluator in .NET? Converting string expression to Integer Value using C# Best and shortest way to evaluate mathematical expressions c# evaluating string 3*(4+2) yield int 18 Is there a way to calculate math expressions like (2-3/4*12) in a different way than presented here? h...

Complicated programming and math tasks online. Any?

Possible Duplicate: What are some good websites for programming puzzles? Maybe it is not very thematic question in here, but I guess it will be interesting not only to me. I hope. So, I just want to get some cool tasks to do using programming languages or just pen and sheet of paper. I guess it can lead to improving my abilit...

Calculating intraday candlesticks by time intervals

This maybe an over asked question, but my mind draws blank at this moment. I know what a candlestick chart is and how to draw it daily. But how to draw it intraday at asked time periods. I have this server, written in Java, that gives me trade depth (each trade done since the start of the day). Its just a stream of raw data: price, share...

How to find coordinates of a 2d equilateral triangle in C ?

Hello, I have the coordinates (x,y) of 2 points. I want to build the third point so that these 3 points make an equilateral triangle. How can I calculate the third point? Thank you ...

How do I get the Math equation of Python Algorithm?

ok so I am feeling a little stupid for not knowing this, but a coworker asked so I am asking here: I have written a python algorithm that solves his problem. given x > 0 add all numbers together from 1 to x. def intsum(x): if x > 0: return x + intsum(x - 1) else: return 0 intsum(10) 55 first what is this type of equation ...

Why are there 3 conflicting OpenCV camera calibration formulas?

I'm having a problem with OpenCV's various parameterization of coordinates used for camera calibration purposes. The problem is that three different sources of information on image distortion formulae apparently give three non-equivalent description of the parameters and equations involved: (1) In their book "Learning OpenCV…" Bradski ...

pow doesn't accept the second parameter to be a variable on gcc

pow doesn't accept the second parameter to be a variable on gcc The following code works fine on VC++10 // file test.cc #include "stdafx.h" #include <stdio.h> #include <math.h> int main(void) { double x = 10; int y = 20; printf("%f\n", pow(x, y)); return 0; } But the following code doesn't not work on gcc: // tes...

Subdividing 3D mesh into arbitrarily sized pieces

I have a mesh defined by 4 points in 3D space. I need an algorithm which will subdivide that mesh into subdivisions of an arbitrary horizontal and vertical size. If the subdivision size isn't an exact divisor of the mesh size, the edge pieces will be smaller. All of the subdivision algorithms I've found only subdivide meshes into exact ...

Make "page-turning" transform (3D) follow x-axis

Hello I'm making an eBook reader for the iPhone. I have made a page-turn with CABasicAnimation and it's working great. Now I want to do the page-turn "manually" by using the x-coordinate when your finger moves along the screen. I've achieve that, but it needs some tweaking to feel more "real". Because of the 3D effect (defined by transf...

Balanced layout of n items in a grid.

I have a list of n logos to display in a grid, with a maximum of 3 per row. What's an algorithm to decide how many to display per row such that the number of logos per row is as balanced as possible without using more than the minimum possible number of rows? For example: n -> number in each row 1 -> 1 2 -> 2 3 -> 3 4 -> 2, 2 5 -...

mod,prime -> inverse possible

Hi all. I was wondering if one can do the following: We have: X is a product of N-primes, thus I assume unique. C is a constant. We can assure that C is a number that is part of the N-primes or not. Whichever will work best. X mod C = Z We have Z and C and we know that X was a product of N-primes, where N is restricted lets say firs...

License key pattern detection?

This is not a real situation; please ignore legal issues that you might think apply, because they don't. Let's say I have a set of 200 known valid license keys for a hypothetical piece of software's licensing algorithm, and a license key consists of 5 sets of 5 alphanumeric case-insensitive (all uppercase) characters. Example: HXDY6-R3D...