← 수업 제작 도구
홈 › Components › Graph and Graphing Calc › 화면 10

화면 10. Graph.currentX/Y [source]

원본: Computation Layer 문서(Graph) · Try It (원본 화면)

화면 번호10 / 29
문서 항목 설명 (원문)currentX: Gets the current x-coordinate of the mouse. Works on hover with a mouse and while depressed for touch.
currentY: Gets the current y-coordinate of the mouse. Works on hover with a mouse and while depressed for touch.

1. 화면 캡처 (빨간 번호 = 아래 표의 번호)

화면 10 캡처

2. CL이 입력된 곳

코드 안의 회색 줄은 원문 영어 주석이고, 파란 줄은 그 영어 주석의 번역이며, 연분홍 줄은 코드가 하는 일의 설명이다.

번호이름종류CL 코드 원문, 번역, 설명
1레이블 없는 그래프그래프
# Create variable x_1 in the graph using the x-location of the cursor
▷ 커서의 x 위치를 이용해 그래프에 변수 x_1을 만든다.
number(`x_1`): this.currentX
▶ 그래프의 변수 x_1은 this.currentX로 한다.
변수 이름을 백틱으로 감싸 적었으며, 백틱으로 감싼 글자는 latex 값이다. this.currentX는 마우스 커서가 있는 곳(터치는 누른 곳)의 x좌표를 알려 준다. 커서를 움직이면 x_1의 값도 같이 바뀐다.
# Create variable y_1 in the graph using the y-location of the cursor ▷ 커서의 y 위치를 이용해 그래프에 변수 y_1을 만든다. number(`y_1`): this.currentY ▶ 그래프의 변수 y_1은 this.currentY로 한다.
this.currentY는 커서의 y좌표를 알려 준다.