Search Results - VBForums

Search:

Type: Posts; User: jemidiah

Page 1 of 13 1

1. Thread: Get X/Y coordinates

by jemidiah
Replies
8
Views
155

Re: Get X/Y coordinates

What you're trying to do and what's not working aren't terribly clear to me, but are you sure you wanted

Dim tilesPerHeight As Double = Math.Floor(Me.Height + ToolStrip1.Bottom / 32)

2. Thread: Prove this

by jemidiah
Replies
2
Views
173

Re: Prove this

Multiply x<1 by x. Since 0<x, this does not reverse the inequalities, so we have 0 < x^2 < x. Take the square root of these inequalities to get 0 < sqrt(x^2) = x < sqrt(x).

The first two sentences...
3. Thread: Combination Picker

by jemidiah
Replies
9
Views
811

Re: Combination Picker

I agree, the question is exactly asking for an efficient algorithm to unrank an index to produce a k-combination. I imagine there's a fair amount of literature on the problem and its generalizations,...
4. Thread: [RESOLVED] Plot ellipse through apex and two other points

by jemidiah
Replies
42
Views
2,858

Re: drawing the Steiner exellipse

That's beautiful and it seems reasonably intuitive. Glad it worked out. Sorry I never got to debugging your earlier post; life got too busy for me to put in the time and effort.
5. Thread: [RESOLVED] Plot ellipse through apex and two other points

by jemidiah
Replies
42
Views
2,858

Re: Plot ellipse through apex and two other points

Sorry for not getting to this. I came down with the flu for the last week and am now playing catch-up. Hopefully soon.
6. Thread: [RESOLVED] Plot ellipse through apex and two other points

by jemidiah
Replies
42
Views
2,858

Re: Plot ellipse through apex and two other points

I'll try to take a look in the next couple of days.
7. Thread: [RESOLVED] Plot ellipse through apex and two other points

by jemidiah
Replies
42
Views
2,858

Re: Plot ellipse through apex and two other points

@Logophobic: Yup. I think bb and I both observed that somewhere above; the working version of the code discussed in post #14 makes it clear empirically. Here's a proof using my formula from post #8....
8. Thread: [RESOLVED] Plot ellipse through apex and two other points

by jemidiah
Replies
42
Views
2,858

Re: Plot ellipse through apex and two other points

Whoops, the cross term is more complicated than just a simple complete-the-square problem. Noting that
A(x-D/(2A))^2 = Ax^2 - Dx + D^2/(4A)
A(y-E/(2C))^2 = Ay^2 - Ey + E^2/(4C)

will get rid of...
9. Thread: [RESOLVED] Plot ellipse through apex and two other points

by jemidiah
Replies
42
Views
2,858

Re: Plot ellipse through apex and two other points

Ah, sorry, I should have explained my notation more explicitly. A, B, C, D, E, and F are all parameters to the general quadratic curve equation,
Ax^2 + Bxy + Cy^2 + Dx + Ey + F = 0,

listed on the...
10. Thread: [RESOLVED] Plot ellipse through apex and two other points

by jemidiah
Replies
42
Views
2,858

Re: Plot ellipse through apex and two other points

Hmm. I think your problem is still underdetermined. I'll give a system of equations that describe your conditions and then have Mathematica solve them. This shows there is a single free parameter, so...
11. Thread: [RESOLVED] Plot ellipse through apex and two other points

by jemidiah
Replies
42
Views
2,858

Re: Plot ellipse through apex and two other points

I don't think the constraint you've said makes complete sense. You want P2 to be as far as possible perpendicularly from line P1P3 (typo), but on "the arc": you're using this constraint to define...
12. Thread: [RESOLVED] Plot ellipse through apex and two other points

by jemidiah
Replies
42
Views
2,858

Re: Plot ellipse through apex and two other points

In the "normalized" form of post #6, a configuration with the line from P1 to P3 perpendicular to the axis from P2 corresponds to P2=(0, 0), P1=(u, v), P3=(u, -v), i.e. u=r, v=-s. Indeed, then us^2 -...
13. Thread: [RESOLVED] Plot ellipse through apex and two other points

by jemidiah
Replies
42
Views
2,858

Re: Plot ellipse through apex and two other points

I wrote (0, A) when I meant (A, 0), so "Dim centre As New PointF(0, A)" should be "Dim centre As New PointF(A, 0)". With that change, when the line connecting P2 and m is horizontal, it generally...
14. Thread: [RESOLVED] Plot ellipse through apex and two other points

by jemidiah
Replies
42
Views
2,858

Re: Plot ellipse through apex and two other points

After looking through the code, it's a faithful implementation (thanks for correcting the typo) except you've reversed the order of the arguments to atan2. Instead of "Dim t As Double =...
15. Thread: Drawing Sine and Cosine Graphs on vb10

by jemidiah
Replies
14
Views
457

Re: Drawing Sine and Cosine Graphs on vb10

Sorry, you'll have to be clearer if you want people to help you. Three things you can do: use [CODE] tags; post your full code rather than seemingly arbitrary fragments; say *clearly* what you want...
16. Thread: [RESOLVED] Plot ellipse through apex and two other points

by jemidiah
Replies
42
Views
2,858

Re: Plot ellipse through apex and two other points

Actually it means exactly the opposite: given u, v, r, s, there is a unique solution A, B^2 to the system of two equations I listed, which can be computed using the formulas I gave. Physically, that...
17. Thread: Drawing Sine and Cosine Graphs on vb10

by jemidiah
Replies
14
Views
457

Re: Drawing Sine and Cosine Graphs on vb10

(The way I remember the conversion is that there are 2pi radians in 360 degrees, so X degrees = X degrees * 2pi radians/360 degrees = X*pi/180 radians.)
18. Thread: [RESOLVED] Plot ellipse through apex and two other points

by jemidiah
Replies
42
Views
2,858

Re: Plot ellipse through apex and two other points

Translate the points so P2 is at the origin. Suppose you wish to make an ellipse with center (0, A). The resulting ellipse is
((x-A)/A)^2 + (y/B)^2 = 1,

for some B^2>0. Let P1=(u, v), P3=(r, s),...
19. Thread: Drawing Sine and Cosine Graphs on vb10

by jemidiah
Replies
14
Views
457

Re: Drawing Sine and Cosine Graphs on vb10

This isn't really a math question, you just happen to be coding something related to math. I've reported the thread so that it should get moved to the more appropriate VB.NET forum. More people will...
20. Thread: Problem regarding convertion of number...

by jemidiah
Replies
10
Views
292

Re: Problem regarding convertion of number...

Hah, that... is disgusting. I would never want to run across it without having written it :).
21. Thread: Random number question

by jemidiah
Replies
4
Views
580

Re: Random number question

For completeness, a general method for this sort of problem is described here. It's almost certainly way more involved than you're after.
22. Thread: Problem regarding convertion of number...

by jemidiah
Replies
10
Views
292

Re: Problem regarding convertion of number...

Sure. It was so straightforward to write that line but now that I'm writing an explanation it seems more involved. There must be a better way to say it, but oh well.

Log(x, b) returns the number y...
23. Thread: Problem regarding convertion of number...

by jemidiah
Replies
10
Views
292

Re: Problem regarding convertion of number...

There's quite a lot wrong with that code. It didn't compile for me at first (needed .ToString() instead of .ToString? kinda weird), but more importantly it's inefficient, overcomplicated, and doesn't...
24. Thread: What point on the graph of f(x) is closest to the origin?

by jemidiah
Replies
3
Views
470

Re: What point on the graph of f(x) is closest to the origin?

I don't think so. I did look at the graph, and +/- sqrt(2) seems very reasonable to me. It's hard to eyeball, unfortunately. Make sure you're looking at it on a graph where the x and y axes have the...
25. Thread: What point on the graph of f(x) is closest to the origin?

by jemidiah
Replies
3
Views
470

Re: What point on the graph of f(x) is closest to the origin?

Points on the graph are (x, 5/2 - x^2), which has a squared distance from the origin of x^2 + (5/2 - x^2)^2 = x^4 - 4x^2 + 25/4. To minimize, the derivative is 4x^3 - 8x = 4x(x^2 - 2), which has...
26. Thread: how to convert binary numbers into decimals or numbers to decimals [HELP]

by jemidiah
Replies
1
Views
430

Re: how to convert binary numbers into decimals or numbers to decimals [HELP]

You'll have to be more specific. Give some examples of problems you want to solve but don't know how.
27. Thread: Reducing numbers to one digit (numerology related)

by jemidiah
Replies
12
Views
793

Re: Reducing numbers to one digit (numerology related)

For what it's worth, this thread seems to have no actual math questions--it's all about coding basic operations on digits and letters. A more appropriate place for this type of post is probably the...
28. Thread: [RESOLVED] Prime Numbers

by jemidiah
Replies
10
Views
752

Re: Prime Numbers

For what it's worth, the number of distinct results mod n of numbers relatively prime to n is called Euler's totient function phi(n) (Google if interested). It turns out to be really easy to compute...
29. Thread: Poker stats.

by jemidiah
Replies
8
Views
631

Re: Poker stats.

How silly, thanks!
30. Thread: Poker stats.

by jemidiah
Replies
8
Views
631

Re: Poker stats.

Just to comment on the five of a kind vs. straight flush question, given X decks, the number of five-card hands which are five-of-a-kind is just (4X choose 5), since there are 4X fives to choose...
31. Thread: Poker stats.

by jemidiah
Replies
8
Views
631

Re: Poker stats.

I could compute/tell you how to compute the probability that a randomly selected 5-card hand using X standard decks is a five of a kind/full house/etc. I don't know how relevant those computations...
32. Thread: Rotate triangle by orthocenter

by jemidiah
Replies
4
Views
823

Re: Rotate triangle by orthocenter

@passel: Nope, that's the barycenter, not the orthocenter. In barycentric coordinates like I discussed in my post, the point you describe has position (1, 1, 1).
33. Thread: Rotate triangle by orthocenter

by jemidiah
Replies
4
Views
823

Re: Rotate triangle by orthocenter

I know nothing about XNA, but there is almost certainly a "rotate" method that'll handle the 2D rotation for you. The formulas are not at all hard, but still, no reason to duplicate work. If not I'd...
34. Thread: An easy famous unsolved problem :

by jemidiah
Replies
12
Views
986

Re: An easy famous unsolved problem :

I'm guessing Atenk confused the Collatz conjecture with a Millennium Prize problem. Those indeed have million-dollar rewards, whereas as far as I'm aware Collatz has just Erdos' \$500 (and someone...
35. Thread: An easy famous unsolved problem :

by jemidiah
Replies
12
Views
986

Re: An easy famous unsolved problem :

Yup, there's a ton of basic work that's already been done on Collatz (which is why I mentioned one of its names). An interesting note is that if you allow negative numbers you get a few more loops,...
36. Thread: An easy famous unsolved problem :

by jemidiah
Replies
12
Views
986

Re: An easy famous unsolved problem :

I fiddled with the Collatz conjecture for a few days once and got pretty much nowhere, which seems to be everyone's situation :). Well, I vaguely remember finding a few results or equivalences I've...
37. Thread: Stock Control

by jemidiah
Replies
1
Views
345

Re: Stock Control

You could always use a more complex structure to store the info. For instance, you could store a polygon representing the sheet of glass in its current state, where a 2400x1200 sheet would just be...
38. Thread: Plotting points and accounting for resize

by jemidiah
Replies
5
Views
926

Re: Plotting points and accounting for resize

Is there a reason you're using "angles(i) = CInt(i * Math.PI / 3)" instead of "angles(i) = i * Math.PI / 3" (with angles() a floating point array)? Decimals really matter for radian angles and...
39. Thread: Plotting points and accounting for resize

by jemidiah
Replies
5
Views
926

Re: Plotting points and accounting for resize

It's hard to say what's wrong when you haven't posted much of your actual code, especially since the problem seems to be the edge labels but you've shown no edge label code. Still, it's probably...
40. Thread: This interest rate, how ?

by jemidiah
Replies
21
Views
1,657

Re: This interest rate, how ?

I agree entirely Niya :). I just thought for someone needing help translating from Python to .NET, functions as arguments might be a concept they hadn't seen before, so I pointed it out.
Results 1 to 40 of 500
Page 1 of 13 1

Featured

Click Here to Expand Forum to Full Width