Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - 3rik

Pages: 1 2 3 [4] 5 6 ... 8
46
Humour and Jokes / Re: Translation Party!
« on: January 29, 2012, 04:46:52 pm »
This explains so much!

http://www.translationparty.com/#10017581

Quote from: Rick Astley (sort of)
Heart of my soul is crying in the desert.

http://www.translationparty.com/#10017843

47
Math and Science / Re: Calculating Trajectories
« on: January 19, 2012, 10:15:08 pm »
I found a seemingly helpful resource. It takes everything I want accounted for.  ;D
http://people.stfx.ca/smackenz/Courses/DirectedStudy/Volleyball%20Project/Kao%201994%20A%20mathematical%20model%20for%20the%20trajectory%20of%20a%20spiked%20volleyball%20and%20its%20coaching%20application.pdf

Unfortunately, I don't understand it.  :banghead:
It gives the equations for acceleration and suggests using the Runge-Kutta scheme to find the position of a ball given the starting position, the initial velocity, and some other stuff.

Otherwise, I found code for Mathmatica that is supposed to do something similar, but I don't have an extra $140 to buy Mathematica.  :(
Here's the link if someone wants to try this approach. http://www.fysik.org/WebSite/fragelada/resurser/GolfBallDynamics.pdf

This is a legal double post.
Yay! Triple Posting!

48
Math and Science / Re: Calculating Trajectories
« on: January 17, 2012, 10:57:30 pm »
I found the 2D parametric equations for the trajectories of objects where k is the drag coefficent, V0 is the initial velocity, g is the acceleration due to gravity, θ is the angle above the ground and x0 and y0 are the starting coordinates.



To add the third dimension I know I just need to do a simple rotation but I still need to figure out the backspin part.
This is a legal double post.

49
Quote from: http://www.whitehouse.gov/blog/2012/01/14/obama-administration-responds-we-people-petitions-sopa-and-online-piracy
While we believe that online piracy by foreign websites is a serious problem that requires a serious legislative response, we will not support legislation that reduces freedom of expression, increases cybersecurity risk, or undermines the dynamic, innovative global Internet.

It sounds hopeful that someone will do something to stop these bills and focus on the sites actually causing problems.

50
Math and Science / Re: Calculating Trajectories
« on: January 16, 2012, 10:20:05 am »
This kind of makes sense.

I have a few questions.

What does S stand for?

Do these factor in air resistance? (I forgot to be specific in my post)

And what if I want φ to be the variable instead of x and y?

EDIT 1: Since the Magnus force is perpendicular to the direction the ball is traveling, wouldn't it affect the x and y coordinates too?

EDIT 2: I was looking at this but I have no idea of how to put all this information together. http://rockstarscience.net/baseball/HowToHitHomeRuns.pdf (ignore the bat stuff)

51
Math and Science / Calculating Trajectories
« on: January 15, 2012, 09:51:23 pm »
I'm working on a problem that involves accurately predicting the trajectory of a ball.

To simplify things a bit let's say I have a cannon that is capable of putting backspin on the cannonball. This cannon is capable of moving anywhere on the ground. It can adjust the angle it is firing at and how fast it shoots the cannonball. How do I determine what position, angle, and speed I need to hit a target in 3D space?

While looking on the internet I found a bunch of things that involved differential equations, the Magnus Effect, and integrals.

I haven't taken high school physics yet and I am only learning beginning to learn about definite integrals in calc 1.

If there's anyone that can explain a method for finding this that doesn't involve too much advanced calculus, they would be really helpful. It may eventually be included in a program so the less symbolic stuff the better.

Thanks in advance.

52
TI-Nspire / Re: [Lua] Mancala
« on: January 14, 2012, 05:28:57 pm »
Is there any advantage with using on.create?

This is what the Nspire Scripting Application Programming Interface document says.

Quote from: Nspire Scripting Application Programming Interface
15.13     create
on.create()
This routine is called when the script application is created. The window size and graphics context are valid at this point.
Use this routine to initialize graphical objects based on the window size. Don’t actually paint the screen in this routine since the on.paint event handler will be called soon after this routine finishes.

If you are making an app that depends on the screen size you can then use platform.window:height() or platform.window:width() to do calculations. I suppose you could call it later in the program again. I was just testing to see if I had any issues with it.

53
TI-Nspire / Re: [Lua] Mancala
« on: January 14, 2012, 05:11:05 pm »
@adriweb I thought table.getn was removed after Lua 5.0 and replaced with the # operator.

@epic7 It depends on how Lua was set up on the system. I don't know the details because that gets into complicated C stuff.
I can take a look at your code to see if I can spot an optimization.

54
TI-Nspire / Re: [Lua] Mancala
« on: January 13, 2012, 11:51:11 pm »
And also, is there an easy way to add something to the end of the table and count the number of things in a table?

There are a few ways of determining the length of a table.

The most obvious way is using the operator #. It basically starts at 1 and keeps adding 1 until it reaches a nil value. If there are any holes in your table this will give a smaller value.

Another way to get a length is to use table.maxn(). It returns the key with the highest value. In my previous example #example == 1 but table.maxn(example) == 1337. This can also handle decimal numbers in the keys.

One way to count all the elements in a table would be to use a function like this:
Code: [Select]
function length(example)
local index = 0
for _, __ in pairs(example)
index = index + 1
end
return index
end

This will count every element in the table (except nil values, of course). I'll bet this way will be quite slow as the number of elements increases.

If you wanted to add signal to show the end you could do something like this:
Code: [Select]
stuffs = {1, 3, 5, 3, nil, "end"}

function length2(example)
local index = 1
while example[index] ~= "end" do
index = index + 1
end
return index - 1
end
length2(stuffs) would return 5. However, in order to place the "end" into the table, you would have had to know where to put it and if you add or take away any elements you would have to adjust where "end" goes.

55
TI-Nspire / Re: [Lua] Mancala
« on: January 13, 2012, 11:04:01 pm »
@someone I'd agree that that code looks neater. I was just being lazy and I only made the minimum amount of changes from epic7's code.

@ epic7 and cyanophycean314 I see that you're testing the program in oclua. By the time you paste the code in the program, the event on.create() has already been called so coord was never initialized.

56
Introduce Yourself! / Re: Hello World!
« on: January 13, 2012, 12:33:03 am »
Welcome systwo to Omnimaga!

Here are some extra peanuts in case they don't give you any on your next trip.

!peanuts

jwalker, you can give peanuts by typing !peanuts

57
TI-Nspire / Re: [Lua] Mancala
« on: January 13, 2012, 12:11:20 am »
Looked through the code a bit more and edited a couple things
Code: [Select]
function on.create()
coord = {}
for a=1, 14 do
for b=1, 3 do
if a~=7 and a~=14 then
coord[a*9+b*3-11]=a --Changed all the 3s in front of the as to 9s also changed the 5, 4, and 3 to 11, 10, and 9 so that it would still start at coord[1]
coord[a*9+b*3-10]=math.random(0,16)
coord[a*9+b*3-9]=math.random(0,14)
else
coord[a*9+b*3-11]=a
end
end
end
end

function on.paint(gc)
for a=1, 42 do
if coord[a*3-2]~=7 and coord[a*3-2]~=14 then
if coord[a*3-2]>7 then
gc:fillArc((coord[a*3-2]-7)*38+coord[a*3-1],coord[a*3]+49,10,10,0,360) --subtracted 7 from coord[a*3-2] to line up the pieces
else
gc:fillArc(coord[a*3-2]*38+coord[a*3-1],coord[a*3]+141,10,10,0,360)
end
end
end
end

Using this code, I got the screenshot below. I made a couple extra tweaks to the numbers so that the pieces would line up.

As for adding things to tables, as long as the table has been initialized with a table constructor, any valid key can be paired with any valid value.

Code: [Select]
example = {}
example[1] = 1
example[1337] = 3.141592
example["The Game"] = on.paint
example[on.create] = "Never Gonna Give You Up"
example[true] = false
example.Omnimaga = {1, 2, 3, 4} --Same as example["Omnimaga"] = {1, 2, 3, 4}

Be wary though, #example ~= 1337 until example[2] through example[1336] have non-nil values

58
TI-Nspire / Re: [Lua] Mancala
« on: January 11, 2012, 10:27:25 pm »
I noticed that some values in the coord table are being overwritten. Like when a=1 and b=2 coord[4]==1 but when a=2 and b=1 coord[4]==2.

I'm running out of ideas for what is causing this error without seeing more code.

Local variables are variables that are initialized with the word local in front of them. They only last until the end of the block they are created in. They can share the name of global variables. A description of this  can be found here: http://www.lua.org/pil/4.2.html

59
TI-Nspire / Re: [Lua] Mancala
« on: January 11, 2012, 09:56:43 pm »
Are there any local coord variables?

60
Introduce Yourself! / Re: Greetings!
« on: January 11, 2012, 09:50:54 pm »
I come bearing the gift of peanuts!

!peanuts

I hope you enjoy your time at Omnimaga.  :)

Pages: 1 2 3 [4] 5 6 ... 8