|
Are you using vb.net if so I have something that might help. If your not using vb you may be able to convert it to c or whatever flvor you like, I think the code I originally got my example from was java and I rewrote and expanded on it for vb.net.
The program draws a curve, then you click on the curve, if the x,y appears on the curve the curve is redrawn showing where you clicked and splitting the curve.
It's not commented but you should be able to figure it out.
If interested let me know and I can send the code, it's app. 68kb and I did not want to clutter up the board.
|
|
|
|
|
Funny![^]
There are II kinds of people in the world, those who understand binary and those who understand Roman numerals. Web - Blog - RSS - Math
|
|
|
|
|
I am getting "Page Not Found" Error.
Regards,
Arun Kumar.A
|
|
|
|
|
It is gone now.
"Patriotism is your conviction that this country is superior to all other countries because you were born in it." - George Bernard Shaw
Web - Blog - RSS - Math - LinkedIn - BM
|
|
|
|
|
I have a problem that I'm sure there must be a mathematical solution for. What I am trying to do is create a random triangle within a square area with as large an area (of the triangle) as possible (i.e. it would cover 50% of the area of the square). It's easy to imagine that you could pick two corners and then pick a random point along the opposite edge and you would achieve this. No problem. My problem is that I want to take this into higher dimensions. So now if you think about a tetrahedron in a 3D cube you could imagine picking any three corners on the same face and then picking a random point on the opposite face and that (I think) will give you the largest volume tetrahedron you can fit in a cube. But now what about a 4D simplex (a pentatope) in a 4D box (a hypercube? I'm not sure of the nomenclature here). Or a nD simplex in a nD box? Does anybody know if there is a general way to do this? Something I can convert to code.
For background, I am playing with the Nelder-Mead simplex method and I'm trying to evaluate the algorithm with random starting simplex, the problem is that, especially in higher dimensions, if I start with a random simplex they tend to be too small to start (for example, with the tetrahedron you could imagine you might end up with 4 points all on the same plane which gives you a volume of 0).
Thanks
|
|
|
|
|
So here's what I tried so far. I thought, after writing my last post, that I could probably select one dimension (of n total dimensions) and hold that constant at the max (or min) for that dimension for the first n points of my simplex with the other dimensions being corners of that "face". Then I make the last point be random in all dimensions except my previously selected dimension where it would have a value putting it on the opposite face to my first n points. This works fine for 2 and 3D simplex, but falls down again once you go to 4D. Sometime it appears to work and gives me a high contents (hypervolume?) for my simplex, but other times it doesn't and I'm not sure what combination of parameters are causing that.
Any geometry wiz got any help here?
|
|
|
|
|
I am not able to give you the exact solution but maybe you can find some useful info from below.
Since your problem is actually a maximal area problem, we have two things to overcome. First, in 4 dimesional space you need the concept of volume ( hypervolume etc ). You can evaluate it bu multiple integrals as in the two or three dimesional case. However, they will loose their natural meanings. Secondly, all of these can be solved analyticly. I mean you can use linear algebra and basic calculus to solve such a question.
I remember that there are exact formulas of volumes for 3 dimensional case and Maple can evaluate them. 4 dimelsional case should be just a generalization. For more information about symmetry of such objects, you can search advanced Groups and Symmetry books .
|
|
|
|
|
for nPr then "set of Permutaion of a string containing n character = Number of Combination of that string + Number of combination of reverse of that string" Provided r != 1
Is this valid
Warm Regards
Mushq
|
|
|
|
|
Please clarify. P= ? r=? - is r the number of different characters?
why would Number of Combinations of string not be inclusive (in fact identical to) Number of combinations of reverse of string, after the reverse is just one of the possible combinations...
|
|
|
|
|
Hi, what is your question ?
|
|
|
|
|
sorry for vague description.
suppose we have string "abc", here n = 3(length of string) and r = 2, then total number of permutation of r sets are.
1)"ab"
2)"ac"
3)"bc"
4)"ba"
5)"ca"
6)"cb"
and for calcuating combination of string "abc" , here n = 3, and r = 2
1)"ab"
2)"ac"
3)"bc"
and similarly for "cba", here n =3, and r = 2
6)"cb"
5)"ca"
4)"ba"
In above example permuations of string is equivalent = combination of string + Combination of Reverse String.
I hope so it is clear now
Warm Regards
Mushq
|
|
|
|
|
Ah! you are imposing an extra condition on the "Combinations" - they must be the subset r memberstaken in order
|
|
|
|
|
|
No.
n!
nPr = ------
(n-r)!
n!
nCr = ---------
(n-r)!*r!
Permutations = a set of elements in which order matters.
Combination = a set of elemets in which order does not matter.
nPr = nCr * r!
Permutations = (elements of subset)*(# of ways to order subset)
Example
-------
SET = {a,b,c,d}
4P3 = 24:
{a,b,c},{a,c,b},{b,a,c},{b,c,a},{c,a,b},{c,b,a}
{a,b,d},{a,d,b},{b,a,d},{b,d,a},{d,a,b},{d,b,a}
{a,c,d},{a,d,c},{c,a,d},{c,d,a},{d,a,c},{d,c,a}
{b,c,d},{b,d,c},{c,b,d},{c,d,b},{d,b,c},{d,c,b}
4C3 = 4:
{a,b,c}
{a,b,d}
{a,c,d}
{b,c,d}
in this case r=3 => r!=6
4P3 = 4C3 * 3! = 4 * 6 = 24
Notice that each line under 4P3 is the number of permutations of the corresponding line under 4C3.
-Sean
----
Shag a Lizard
|
|
|
|
|
Wonderful, thanks for the detailed answer,as i might going to produce a buggy application
|
|
|
|
|
I give up. I've fiddled with this problem for months (in a part-time way) and can't find a solution. In a power system using overhead lines we have to design to meet certain minimum heights above ground for electric lines. As it would require infinite tension on the line to make it perfectly horizontal, all lines have some amount of sag. I was raised to believe in the laws of physics and mathematics, and in my ignorance assumed that there is some simple equation that is well known in the industry for calculating this important factor. It turns out that there isn't; engineers use tables of empirical data for various types of wire to do their designs. That's just plain wrong!
Given a pair of poles, with a cable rigidly affixed at each end, set a known distance apart, it should be possible to calculate how much sag will exist for any applied tension. I haven't a clue how to do it, however. The cable types are well characterized, with weights per foot, modulus of elasticity, and tensile strength published. Why should this be so hard?
So, the challenge is to derive an algorithm to calculate the sag from known data, without having to first build it. A second part of the challenge is to calculate the final sag (after the wire has stretched a bit from its initial sag), which should occur a few days after stringing.
Extra points will be awarded for an adjustment factor that allows for temperature variations of +/- 100C. More than that would be futile, as aluminum anneals badly above 200C.
Any tries?
"...a photo album is like Life, but flat and stuck to pages." - Shog9
|
|
|
|
|
Tell the truth, this has something to do with boobs and not power lines?
"I know which side I want to win regardless of how many wrongs they have to commit to achieve it." - Stan Shannon
Web - Blog - RSS - Math - LinkedIn
|
|
|
|
|
I admit only that it might have multiple applications...;)
"...a photo album is like Life, but flat and stuck to pages." - Shog9
|
|
|
|
|
Roger Wright wrote: Why should this be so hard?
Ask the Bernoulli brothers.
A cable hanging under the force of gravity from 2 fixed points makes a catenary curve. It took the Bernoulli's a long time to discover the equation of this curve (using the calculus of variations).
Y = a*cosh(x/a)
where a = height of the cable above ground at it's lowest point.
Y(0) = a
Y(-d/2) = Y(d/2) = h
where d is the distance between poles and h is the height of the attached wire at the pole. (Each end is assumed to be at the same height on level ground).
Y(d/2) = h = a*cosh(d/(2a)) = a/2 * [exp(d/(2a)) + exp(-d/(2a))]
=> h = a/2 * [exp(d/(2a)) + exp(-d/(2a))]
solving for a is not trivial, thus the tables of empirical data.
http://www.powline.com/products/sagsec.html[^]
-Sean
----
Shag a Lizard
|
|
|
|
|
Also known as the brachistochrone problem.
"I know which side I want to win regardless of how many wrongs they have to commit to achieve it." - Stan Shannon
Web - Blog - RSS - Math - LinkedIn
|
|
|
|
|
Bassam Abdul-Baki wrote: Also known as the brachistochrone problem.
Related to the catenary problem, but not exactly the same. Brachistochrone problem is the problem of finding the path of shortest time between two points.
An example of the brachistochrone problem is the problem of finding the path light travels between two points (optical path length). Contrary to popular belief, light does not travel the shortest distance between two points, but the path of shortest time between two points.
-Sean
----
Shag a Lizard
|
|
|
|
|
I stand corrected. Light is overrated anyway.
"I know which side I want to win regardless of how many wrongs they have to commit to achieve it." - Stan Shannon
Web - Blog - RSS - Math - LinkedIn
|
|
|
|
|
Cool!
I've looked at Sagsec before, but I doubt the boss wants to buy it at that price. But it would be fun to write my own version. Thanks! I knew I could count on 3.3 million geniuses to find some practical solutions.
"...a photo album is like Life, but flat and stuck to pages." - Shog9
|
|
|
|
|
If you do finish it, send a post.
Perhaps we can turn it into a cool game. :->
Any ideas?
|
|
|
|
|
Here (scroll down past the parabola stuff)[^] is an interesting derivation that solves for the height of the poles above the lowest point of the catenary in terms of the weight per unit length and the tension at the poles, which is at least a close starting point to what you are looking for (same as sag). Calculating the initial deformation (final sag) is left up to you, it changes the weight per unit length, but how much? I'm sure the solution assumes perfect inelasticity along the length of the cable, so it is a starting point at best. The derivation might give some additional clues, since it is based on the solution for the length of such a curve. Perhaps deriving the stretch due to tension first, would be a useful direction to go.
|
|
|
|
|