Editing PowerTransmitter
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 66: | Line 66: | ||
==Alignment formulas== | ==Alignment formulas== | ||
− | All dataports points north, the delta values are calculated from: " | + | All dataports points north, the delta values are calculated from: "reciever coordinate" - "emitter coordinate" |
Horizontal for "emitter" = atan2( delta-x / delta-z ) * 180 / pi | Horizontal for "emitter" = atan2( delta-x / delta-z ) * 180 / pi | ||
<br>Vertical for "emitter" = 90 + atan( delta-y / sqrt( (delta-z)^2 + (delta-x)^2 ) ) * 180 / pi | <br>Vertical for "emitter" = 90 + atan( delta-y / sqrt( (delta-z)^2 + (delta-x)^2 ) ) * 180 / pi | ||
− | Horizontal for " | + | Horizontal for "reciever" = 180 + Horizontal for "emitter" |
− | <br>Vertical for " | + | <br>Vertical for "reciever" = 180 - Vertical for "emitter" |
Comments: | Comments: | ||
Line 79: | Line 79: | ||
<br>Both atan2() and atan() uses radians for the angle, radians are converted to degrees by multiplying with 180 / pi | <br>Both atan2() and atan() uses radians for the angle, radians are converted to degrees by multiplying with 180 / pi | ||
<br>atan2(x/z) should be z/x in a normal situation, but it has been inverted to compensate for the devices inverted rotation direction | <br>atan2(x/z) should be z/x in a normal situation, but it has been inverted to compensate for the devices inverted rotation direction | ||
− | <br>atan(y/x) uses Pythagoras theorem to set x as the horizontal-plane distance between emitter and | + | <br>atan(y/x) uses Pythagoras theorem to set x as the horizontal-plane distance between emitter and reciever |
==IC script== | ==IC script== |