LlAtan2/ko
< LlAtan2
Jump to navigation
Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
예제
<lsl>default {
state_entry() { float num1 = llFrand(100.0); float num2 = llFrand(100.0);
llOwnerSay("y = " + (string)num1); llOwnerSay("x = " + (string)num2);
llOwnerSay("The arctangent of y divided by x is " + (string)llAtan2(num1, num2)); }
}</lsl><lsl>//특정 방향 벡터를 입력값으로 하고 물체의 위치에서 본 해당 벡터의 방향을 반환하는 함수. //by Ramana Sweetwater 2009/01, any use allowed license :-)
string compass (vector target) {
vector me = llGetPos(); float distance = llVecDist(me, target); list DIRS =["W","NW","N","NE","E","SE","S","SW","W"]; return llList2String(DIRS,llCeil(4.5-((4*llAtan2((target.y-me.y)/distance,(target.x-me.x)/distance))/PI)));
}</lsl>
이 글이 유용하지 않으세요? LSL Wiki의 관련항목이 도움을 줄 수 있을 지도 모릅니다.