Forum » Maths conversation

## Maths conversation

 MageKing17 10 years ago Not off of the top of my head.If you need to calculate the number of seconds that have passed between two date/time pairs (assuming no wierdness like leap seconds), I'm totally there, however. I just spent over an hour making it work on my TI-92+. # quote
 E_net4 10 years ago I bump this topic because the previous problem wasn't solved yet. # quote
 Amarth 10 years ago The one of the triangle? I'm not quite sure what you need, but I can think of something on top of my head... I doubt it'll be useful for computer graphics though.Let the triangle be given by the points A,B and C. Let D(t) = t*B + (t-1)*C for 0 <= t <= 1. Then is E(s,t) = s*A + (s-1)*D(t) for 0 <= s <= 1 a parametrization of the triangle. I think.Motivation: D(t) is a parametrization of the line segment BC. For each t between 0 and 1, you have a point on the edge. Also, E(s,t) is a parametrization of the line segment from A to D(t) for each t. The triangle is the union of those line segments for s between 0 and 1. # quote
 E_net4 10 years ago I thought at first that I could use equations to determine what area to draw for the triangle. If you have another idea, please do tell me. # quote
 Amarth 10 years ago Use a decent library. Like, you know. OpenGL or something. That thing basically perfected the art of drawing triangles.Apart from that, really, this is hard stuff. You might want to start thinking about how you'd draw a line between two points if there was no function for that (a solution). Now do that again, but with lines stacked on each other to create the triangle. Alternatively, use 3 lines and then use flood fill.Mind you, this is going to be mind boggling, eye aching, ear bleedingly slow, buggy, and annoying. Your call. # quote
 E_net4 10 years ago I find that Algorithm to be the thing I need. I intended to do this without a library at all (I know it's not recommended).Anyways, I just hope I end this once and for all. Meanwhile, you can gaze upon my sequence. # quote
 E_net4 10 years ago Meet my new mathematical problem!So I have a point's position (X px,Y px). I need a funtion to return (X,Y). Some extra information is provided on the bottom.FYI "tg" = "tan" # quote
 Grim Reaper 10 years ago So basically wish to know which tile the point is on? # quote
 E_net4 10 years ago "Grim Reaper" said:So basically wish to know which tile the point is on?Yes. Any clue? # quote
 Idiota 10 years ago It's vacation, which means that my brains are running in sleep-mode. Ask Amarth. :p # quote
 Amarth 10 years ago I'm sorry. I'd solve it by multiplying a scaling and rotation matrix and adding a translation vector to it, but I guess that's not the answer you're looking for. Pity, really, cause linear algebra is useful for defining affine transformations.I might work out the formulas if I can find some time. You can ask Anarion how much time I have, though. # quote
 MageKing17 10 years ago It would help if you supplied the dimensions of the diamonds. I don't fancy guessing based on the scale of that apparently-slightly-inaccurate diagram. # quote
 E_net4 10 years ago You mean the dimensions in pixels? If so, the height would be 32px. You can calculate the width with this value. # quote
 Amarth 10 years ago Urghl. I worked on this for an hour yesterday trying to get the formulas and it didn't work out. And I know see why: against my assumptions, it's a non-isometric transformation due to that 120° angle.I've never really worked with shear transformations, I hope I can make it work. Lemme see... # quote
 MageKing17 10 years ago Is it just me, or is the bottom part of the diagram wrong?If the tangent of 60 degrees was X / 1, why is 1 the vertical line (I.O.W., the Opposite)? Shouldn't it be 1 / X? # quote
 Amarth 10 years ago It's just you. 60° is the angle between the green line and the left side of the diamond, thus the opposite is X. The green and blue lines are angle bisectors. # quote
 MageKing17 10 years ago Nevermind, though you're right. I answered my own question, if I'd just bothered to pay attention. # quote
 E_net4 10 years ago Heh, at least it's nice that you're trying to help me.Well there has to be a way. Simcity* can do it, then why not my programs?*Simcity 2000 or 3000 # quote
 Nuklearni-okurka 10 years ago 1 + 1 = ? # quote
 MageKing17 10 years ago "Nuklearni-okurka" said:1 + 1 = ?Why, 11 of course. # quote
 Grim Reaper 10 years ago "MageKing17" said:"Nuklearni-okurka" said:1 + 1 = ?Why, 11 of course.It's also 10. # quote
 E_net4 10 years ago "Grim Reaper" said:"MageKing17" said:"Nuklearni-okurka" said:1 + 1 = ?Why, 11 of course.It's also 10.Could also be b. # quote
 Grim Reaper 10 years ago "E_net4" said:"Grim Reaper" said:"MageKing17" said:Why, 11 of course.It's also 10.Could also be b.Not to mention 42. # quote
 E_net4 10 years ago "Grim Reaper" said:"E_net4" said:"Grim Reaper" said:It's also 10.Could also be b.Not to mention 42.For the lulz. # quote
 MageKing17 10 years ago It's also 98... or 62. # quote
 Grim Reaper 10 years ago "MageKing17" said:It's also 98... or 62.Could be 23 as well. # quote
 E_net4 10 years ago Huh... Did anyone mention 2? # quote
 Grim Reaper 10 years ago "E_net4" said:Huh... Did anyone mention 2? MageKing mentioned it in Unary, and I mentioned it in Binary. # quote
 MageKing17 10 years ago "Grim Reaper" said:Could be 23 as well.I'm afraid I don't get that one. # quote
 Grim Reaper 10 years ago "MageKing17" said:"Grim Reaper" said:Could be 23 as well.I'm afraid I don't get that one.If you define "1" to be a function that returns 11.5, you get 11.5 + 11.5, which equals 23. # quote
 Amarth 10 years ago Also in the fields F3 and F7 and the commutative ring Z/(21Z), you have that 1+1 = 23. # quote
 Narvius 10 years ago Uh...I've got a question.Is that true:{` for [0 <= n <= 9] [0,(n) * 9 = n] Because... [0,(n) * 10 - 0,(n) = n,(n) - 0,(n) = n] But I'm not sure if that's true: [0,(5) * 10 - 0,(5) = 5,(5) - 0,(5) = 5] The same for numbers above 9 - but it must be multiplied by that much 9's as it has digits, for example: [0,(12345) * 99999 = 12345,(12345) - 0,(12345) = 12345]`}?Also...[n / 9 = 0,(n)]So [0,(9) = 1], right?(I'm a droid, yay!) # quote
 E_net4 10 years ago You know, I'd poke someone else for this one. I wouldn't mess with finite decimal representations, although that appears to be fine. # quote
 MageKing17 10 years ago I'm unfamiliar with the notation. Does it represent infinitely repeating decimals? # quote
 Narvius 10 years ago Yes. # quote
Forum » Maths conversation