Jump to content

I Need Help with a Mathemetical Operation


TallgeeseIV

Recommended Posts

I'm trying to figure out the equation to use to change a number from a starting point of 45 to an endpoint of 0, based on another number being between 0 and 90.

 

basically when the second number is 0, the first number needs to be 45, when the second number is 45, the first number needs to be 22.5 and when the second number is 90, the first number needs to be 0, and everything in between. this is for a wscript i'm writing but the rest of the script isn't important right now, just need this equation. i'm apparently terrible at math because i've been working on this literally all week with no luck, and i'm sure it's something basic that i'm just too dumb to know off the top of my head.

Link to comment
Share on other sites

I'm trying to figure out the equation to use to change a number from a starting point of 45 to an endpoint of 0, based on another number being between 0 and 90.

 

basically when the second number is 0, the first number needs to be 45, when the second number is 45, the first number needs to be 22.5 and when the second number is 90, the first number needs to be 0, and everything in between. this is for a wscript i'm writing but the rest of the script isn't important right now, just need this equation. i'm apparently terrible at math because i've been working on this literally all week with no luck, and i'm sure it's something basic that i'm just too dumb to know off the top of my head.

 

 

I have no idea what that means TallGeese, however, I remember you were doing something with objects earlier, maybe the feng shuei mod could have an answer. I really have no idea and may be talking out of the thing three feet below my head however.

Link to comment
Share on other sites

Don't worry TallGeese, I haven't forgotten about your problem, I just don't have a complete answer for you yet. You've discovered as I did a while back, that rotational calculations are much more complicated than you might at first suspect. I'm going to follow up in your original thread because there's a much more complete explanation of what you're trying to do there already.
Link to comment
Share on other sites

Don't worry TallGeese, I haven't forgotten about your problem, I just don't have a complete answer for you yet. You've discovered as I did a while back, that rotational calculations are much more complicated than you might at first suspect. I'm going to follow up in your original thread because there's a much more complete explanation of what you're trying to do there already.

 

Ah, that sounds good. I tried it several different ways now and i felt the other thread might be confusing. i started a new approach so i made a new thread for it.

 

i did check out feng shui and it didn't have any answers for me. in feng shui you still rotate objects on the world axis, not sideways from the player's heading, unfortunately.

 

and you're absolutely right, this is the hardest time i've ever had with a script.

Link to comment
Share on other sites

I'm trying to figure out the equation to use to change a number from a starting point of 45 to an endpoint of 0, based on another number being between 0 and 90.

 

basically when the second number is 0, the first number needs to be 45, when the second number is 45, the first number needs to be 22.5 and when the second number is 90, the first number needs to be 0, and everything in between. this is for a wscript i'm writing but the rest of the script isn't important right now, just need this equation. i'm apparently terrible at math because i've been working on this literally all week with no luck, and i'm sure it's something basic that i'm just too dumb to know off the top of my head.

 

If X is 45 when Y is 0

and X is 0 when Y is 90

Then

X = 45 - (Y / 2)

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...