Suppose I have the following:
A region defined by minimum and maximum latitude and longitude (commonly a 'lat-long rect', though it's not actually rectangular except in certain projections).
A circle, defined by a center lat/long and a radius
How can I determine:
Whether the two shapes overlap?
Whether the circle is entirely contai...
I have a problem involving a collection of continuous probability distribution functions, most of which are determined empirically (e.g. departure times, transit times). What I need is some way of taking two of these PDFs and doing arithmetic on them. E.g. if I have two values x taken from PDF X, and y taken from PDF Y, I need to get t...
Even something very rudimentary is fine. Like entering and evaluating something like x+1, where x is a variable I get to specify.
I was thinking of writing my own using Strings for each formula, regex for parsing them, etc., but let's assume my goal is to be as lazy as I can possibly get away with, and that if there's another option (e...
hi,
does anyone know how to write a program in pytohn that will calculate the addition of the harmonic series. i.e.1/2 +1/3 +1/4...
thanks.
lincoln
...
I know:
The control points a and d (start and end point of a 2D cubic bezier curve)
The slopes a->b, c->d, and b->c (b,c the other control points)
Where the halfway point of the Bézier curve is.
Now, given this information, what is the formula for the positions of control points b and c ?
...
Hi,
I recently faced a problem of presenting the output of simple genetic algorithm that looks for extremes of 2 argument function f(x1,x2) . I would like to be able to use x1 as x, x2 as y and f as z and to draw points in 3d space that I could rotate. ( I'm currently drawing this on bitmap using color as the 'z axis'.)
Where should I ...
I grabbed a database of the zip codes and their langitudes/latitudes, etc from this
This page. It has got the following fields:
ZIP, LATITUDE, LONGITUDE, CITY, STATE, COUNTY, ZIP_CLASS
The data was in a text file but I inserted it into a MySQL table. My question now is, how can i utilise the fields above to calculate the distance ...
I need your help,
For example I have a decimal type variable and I want to round up this way.
Eg
3.0 = 3
3.1 = 4
3.2 = 4
3.3 = 4
3.4 = 4
3.5 = 4
3.6 = 4
3.7 = 4
3.8 = 4
3.9 = 4
4.0 = 4
4.1 = 5
4.2 = 5
etc....
How can I do that?
...
By stroke of the cubic bezier curve I mean rendering a curve 'A' with a specific line width 'w'.
How can I derive other cubic bezier curves that describe the outline of the stroke of bezier 'A' ?
...
I have a large (12 digit) BCD number, encoded in an array of 6 bytes - each nibble is one BCD digit. I need to multiply it by 10^x, where x can be positive or negative.
I know it can be done by shifting left or right by nibble instead of bit, but it's a horrible implementation - especially in Javacard, which is what I'm using. Is there...
Should an API provide Rect::contains(Point) or Point::is_inside(Rect) or both?
or Math::contains(Point, Rect) cause it's symmetric?
The same Q goes for LineSegment::contains(Point), Rect::fully_contains(Circle) etc.
...
I have the following HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<style>
.box
{
border:solid black 1px;
padding:0px;
margin:0px;
}
</style>
<...
It has been discussed on this site before about the relationship between math and programming, and whether one is a subset of the other, etc.
In my recent study of programming, I've found myself more and more wishing I was better at math. You all know the scenario when programming books start to generalize something in a math way ("Ther...
I saw this topic and had a bit of a different question.
I've taken almost all the math classes necessary for a CS degree (Calculus I-III, Linear Algebra, Discrete Math, and I'll be taking Statistics this semester). To get a math minor, I only need one more class. Has anybody taken any classes other than these that they found helpful? ...
Hello, I'm trying to implement some basic linear algebra operations and one of these operations is the inversion of a triangular (upper and/or lower) matrix. Is there an easy and stable algorithm to do that?
Thank you.
...
I am doing some population modeling (for fun, mostly to play with the concepts of Carrying Capacity and the Logistics Function). The model works with multiple planets (about 100,000 of them, right now). When the population reaches carrying capacity on one planet, the inhabitants start branching out to nearby planets, and so on.
Problem:...
Does anyone know of a library to do fixed point arithmetic in Python?
Or, does anyone has sample code?
...
I have some expressions such as x^2+y^2 that I'd like to use for some math calculations. On of the things I'd like to do is to take partial derivatives of the expressions. So if f(x,y) = x^2 + y^2 then the partial of f with respect to x would be 2x, the partial with respect to y would be 2y. I wrote a dinky function using a finite differ...
Hi
My math classes are far behind, and I'm currently struggling to find a decent solution to a problem I'm having: I have a tree, in which nodes are actions, and are "weighted" according to multiple criteria : the cost of said action, the time it will take, the necessary resources, the disturbance, etc...
And I want to to find in this ...
What is the best way to approximate a cubic Bezier curve? Ideally I would want a function y(x) which would give the exact y value for any given x, but this would involve solving a cubic equation for every x value, which is too slow for my needs, and there may be numerical stability issues as well with this approach.
Would this be a goo...