Jump to content

Programming challenge - Math Edition

SilicateWielder

So, I have a challenge for you guys, what can you make using the following equation?

 

X = (a) cos * c - (a) sin * c

Y= (a) sin * c + (a) cos * c

 

only the X and Y variables have to match to their corresponding variable as written above in your program. all non-variables must match.

 

X = (5)cos * 10 - (5)sin * 10

Y = (3)sin * 10 - (3)cos * 10

 

Preffered languages are, Python, Javascript, or Scratch; this is for the sake of not everyone being able to code or read C#/C++ and Java. But if you really want you can program in other languages

My procrastination is the bane of my existence.

I make games and stuff in my spare time.

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

I don't get it.

i5 4670k @ 4.2GHz (Coolermaster Hyper 212 Evo); ASrock Z87 EXTREME4; 8GB Kingston HyperX Beast DDR3 RAM @ 2133MHz; Asus DirectCU GTX 560; Super Flower Golden King 550 Platinum PSU;1TB Seagate Barracuda;Corsair 200r case. 

Link to comment
Share on other sites

Link to post
Share on other sites

I don't get it.

 

He's trying to obfuscate getting us to do his homework for him.

The single biggest problem in communication is the illusion that it has taken place.

Link to comment
Share on other sites

Link to post
Share on other sites

He's trying to obfuscate getting us to do his homework for him.

But I don't get what I'm supposed to do.

i5 4670k @ 4.2GHz (Coolermaster Hyper 212 Evo); ASrock Z87 EXTREME4; 8GB Kingston HyperX Beast DDR3 RAM @ 2133MHz; Asus DirectCU GTX 560; Super Flower Golden King 550 Platinum PSU;1TB Seagate Barracuda;Corsair 200r case. 

Link to comment
Share on other sites

Link to post
Share on other sites

But I don't get what I'm supposed to do.

 

I'm not sure either. I got the impression that you need to draw some kind of picture by using the points provided through the listed equations. No idea if I'm right though.

Link to comment
Share on other sites

Link to post
Share on other sites

I'm not sure either. I got the impression that you need to draw some kind of picture by using the points provided through the listed equations. No idea if I'm right though.

 

You're on the right track.

My procrastination is the bane of my existence.

I make games and stuff in my spare time.

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

I can plot a straight line with those, because Y = X.

 

I can also not actually plot anything with those exact expressions, because I'm going to be pedantic and point out that (a)sin*c is not, as written, valid math.

Link to comment
Share on other sites

Link to post
Share on other sites

those are polar equations for a diagram on R^2 of some sort.

 

What confuses me is that written like that, it's pretty much x=y, which is a straight line on the z axis?

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

those are polar equations for a diagram on R^2 of some sort.

 

What confuses me is that written like that, it's pretty much x=y, which is a straight line on the z axis?

 

 

I can plot the origin if a=0 and c in R

 

 

I can plot a straight line with those, because Y = X.

 

I can also not actually plot anything with those exact expressions, because I'm going to be pedantic and point out that (a)sin*c is not, as written, valid math.

To the above, equation had a typo in it, it is now fixed. :)

 

@Azgoth 2, I haven't taken trig classes so I wouldn't know how to properly type out equations using sin and cos outside of code

My procrastination is the bane of my existence.

I make games and stuff in my spare time.

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

I haven't taken trig classes so I wouldn't know how to properly type out equations using sin and cos outside of code

 

Given that sin/cos are functions, I think it's more appropriate to write them like this. It's not completely clear whether it's the 'a' or 'c' that is used by sin/cos, but given the equations, it's not that important because it would work out the same.

X = a * cos(c) - a * sin(c)Y = a * sin(c) + a * cos(c)// orX = c * cos(a) - c * sin(a)Y = c * sin(a) + c * cos(a)
Link to comment
Share on other sites

Link to post
Share on other sites

It's an ellipse. If you take x(t) = a cos(t) - a sin(t) and y(t) = b sin(t) + b cos(t), then you have x^2/(2a^2) + y^2/(2b^2) = 1.

Link to comment
Share on other sites

Link to post
Share on other sites

To the above, equation had a typo in it, it is now fixed. :)

 

@Azgoth 2, I haven't taken trig classes so I wouldn't know how to properly type out equations using sin and cos outside of code

Heh, well, it's not a big deal.  It's still clear what the equations are supposed to be, but just for the record, since sin and cos are functions, the standard way would be to write a*sin© and a*cos©.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×