3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

A math challenge...

Ok, so there's this coding language called FCML- a simple language built for a scripting engine in a game (Fantastic Contraption). I'm wanting to write a script that implements the graph of an equation in the form of axn+b to that gaming language. To clarify, this is to create a "level", or a series of bricks, and fitting them along the line of a user-specified equation. The coding language is very simple:
StaticRect (x1, y1), (x2, y2), z
Where x1 and y1 are coordinates on a Cartesian coordinate plane, x2 and y2 are lengths and widths of the rectangle, respectively, and z is the rotation of the brick. The brick is positioned with respect to it's center; i.e. it's center is positioned with x1 and y1. It's mathematically possible; it's just very confusing for a 7th grader. With a little calculus, trigonometry, and algebra I've come up with these formulas, and would just like to see what others come up with before implementing them.
Input: y=axn
90-tan-1(1/naxn-1) for z
10 for y2
root((axn-a(x-.5)n) + .25) for x2
axn+.5(axn-a(x-.5)n) for y1
x - .25 for x1
I'm aiming for an accuracy of 1/2.

.5x^2.JPG
12 comments
sort by: active | newest | oldest
Feb 14, 2010. 3:49 AMlemonie says:
Your parabolic equation is y = ax2 + bx + c if that helps? a, b, and c are constants that give you the different shapes.

L

Feb 14, 2010. 3:06 AMTheBatchies says:
Uhhhh...6? 6.5?
Jul 31, 2009. 9:30 PMschetleft says:
i remember my old algebra teacher, she would always draw parabolas and intend them to look like penises. any teenager would laugh at their math teacher drawing penises in algebra. haha thats the way i remembered the quadratic formula
Aug 20, 2009. 5:35 PMbounty1012 says:
lmfao.
Jul 31, 2009. 7:18 AMPKM says:
I get the groundwork of what you are trying to achieve, but I'm not sure how you want the bricks to be positioned. Do you want to make a smooth shape like the graph out of rotated bricks, or just position the bricks along the path as steps? The rotation part is harder, as it involves calculus, but fortunately some simple enough calculus that I can remember how to do :) Could you explain how you derived the last three equations? This sounds like quite an interesting problem. I think with a little messing around I could work out an "accurate" solution (ie fit top edges of bricks to a polygonal approximation of the graph). Where did I put my whiteboard...
Jul 30, 2009. 11:12 PMfwjs28 says:
Wow...I was totally confused after like the second line....I'm sure somebody will help you...maybe kelsehmh( I thinkn i spelled that right) , good luck
Jul 31, 2009. 11:46 AMiBurn says:
Yeah...ummm, you might as well have been speaking Basque there. Becuase I didn't understand a word you just said.

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!