← 수업 제작 도구
홈 › Index › inequality (type)

inequality (type) (타입 inequality)

원본: Computation Layer 문서(inequality (type))

코드 안의 회색 줄은 원문 영어 주석이고, 파란 줄은 그 영어 주석의 번역이며, 연분홍 줄은 코드가 하는 일의 설명이다. 항목 설명은 번역이 아니라 해석이며 원문은 접어 둔 "원문(영어) 보기"에 있다.

수학 부등식을 나타낸다.

원문(영어) 보기

Represents a mathematical inequality.

만들기(Creating)

parseInequality function:parseInequality

latex 글자(예: "2x+y>1")를 받아 부등식(inequality) 객체를 돌려준다. 복합 부등식은 알아보지 못한다.

원문(영어) 보기

Takes a latex string, e.g. "2x+y>1" - and returns an inequality object. Does not recognize compound inequalities.

# Create a variable for the inequality created
# from the student's input.
▷ 학생의 입력으로 만든 부등식으로 변수를 만든다.
inequality = parseInequality(i.latex)
▶ 변수 inequality는 parseInequality(i.latex), 즉 구성요소 i의 latex로 만든 부등식 객체로 한다.
parseInequality(latex)는 latex 글자(예: "2x+y>1")를 받아 부등식(inequality) 객체를 돌려주며, 복합 부등식은 알아보지 못한다.
# When the inequality is strictly greater than # or less than, display "strict" otherwise, # display "not strict" ▷ 부등식이 엄밀한 크다/작다이면 "strict"를, 아니면 "not strict"를 표시한다. strictMsg = when inequality.isStrict "strict" otherwise "not strict" ▶ 변수 strictMsg는 inequality.isStrict가 참이면 "strict"(엄밀함), 아니면 "not strict"(엄밀하지 않음)로 한다.
isStrict는 엄밀한 부등식(크다/작다)이면 참, 이상/이하이면 거짓이다. when은 조건을 차례로 확인해 처음 맞는 값을 쓴다.
# Uses isLeftGreater to determine which of the two # sides is greater than the other. If leftIsGreater, # bigger is set to the left side and smaller is set to # the right side. If not, the assignments are switched. ▷ isLeftGreater로 두 변 중 어느 쪽이 더 큰지 알아낸다. 왼쪽이 더 크면 bigger는 왼쪽 변, smaller는 오른쪽 변으로 정하고, 아니면 반대로 정한다. bigger = when inequality.isLeftGreater inequality.lhs otherwise inequality.rhs ▶ 변수 bigger는 inequality.isLeftGreater가 참이면 좌변(inequality.lhs), 아니면 우변(inequality.rhs)으로 한다.
isLeftGreater는 부등식이 어느 쪽을 가리키는지를 알려 주며 "크다"와 "이상"이면 참이다. lhs와 rhs는 방정식(부등식)의 좌변과 우변의 latex 글자이다.
smaller = when inequality.isLeftGreater inequality.rhs otherwise inequality.lhs ▶ 변수 smaller는 inequality.isLeftGreater가 참이면 우변(inequality.rhs), 아니면 좌변(inequality.lhs)으로 한다. # Turn the parsed sides into a function by subtracting # the lesser side from the greater side. ▷ 분석한 두 변을 작은 쪽을 큰 쪽에서 빼서 함수로 만든다. f = inequality.differenceFunction("x", "y") ▶ 변수 f는 inequality.differenceFunction("x", "y")로 한다.
differenceFunction("x", "y")는 (큰 쪽) - (작은 쪽)을 나타내는 simpleFunction이고, f(x,y)>0과 함께 쓰기에 알맞다.
# Create the message to display in the note. ▷ 메모에 표시할 메시지를 만든다. msg = when isDefined(inequality) "Nice. I wonder which is bigger: ${inequality.lhs} or ${inequality.rhs}. Looks like it's ${strictMsg}. And looks like it's true when ${bigger} is greater than ${smaller}. " otherwise "" ▶ 변수 msg는 isDefined(inequality)가 참이면 "Nice.", 다음 줄에 "I wonder which is bigger: ${inequality.lhs} or ${inequality.rhs}."(어느 쪽이 더 큰지 궁금하다: 좌변 또는 우변.), 다음 줄에 "Looks like it's ${strictMsg}."(…인 것 같다.), 다음 줄에 "And looks like it's true when ${bigger} is greater than ${smaller}."(…가 …보다 클 때 참인 것 같다.)를 이은 글, 그렇지 않으면 빈 글자로 한다.
마지막 줄 뒤에도 줄바꿈이 하나 더 들어 있다. isDefined(…)는 정의되어 있는지를 참/거짓으로 돌려주고, ${ }는 글자 안에 변수의 값을 끼워 넣는 표기이다. when은 조건을 차례로 확인해 처음 맞는 값을 쓴다.

속성(Attributes)

rhs type:inequality:rhs

부등식 우변의 latex 글자.

원문(영어) 보기

Latex string for right-hand side of inequality

content:
# Parses and displays separately the
# left and right hand sides of an inequality.
▷ 부등식의 좌변과 우변을 분석해 따로따로 표시한다.
"Enter an inequality.

lhs = `${parseInequality(input.latex).lhs}`
rhs = `${parseInequality(input.latex).rhs}`"
▶ 메모의 내용(content)은 "Enter an inequality."(부등식을 입력하시오.) 다음에 빈 줄을 두고 "lhs = `${parseInequality(input.latex).lhs}`", 그 다음 줄에 "rhs = `${parseInequality(input.latex).rhs}`"를 붙인 글로 한다.
parseInequality(latex)는 latex 글자(예: "2x+y>1")를 받아 부등식(inequality) 객체를 돌려주며 복합 부등식은 알아보지 못하고, lhs와 rhs는 방정식(부등식)의 좌변과 우변의 latex 글자이다. ${ }는 글자 안에 변수의 값을 끼워 넣는 표기이고, content는 메모에 직접 적은 글을 덮어쓴다.

lhs type:inequality:lhs

부등식 좌변의 latex 글자.

원문(영어) 보기

Latex string for lef-hand side of inequality

content:
# Parses and displays separately the
# left and right hand sides of an inequality.
▷ 부등식의 좌변과 우변을 분석해 따로따로 표시한다.
"Enter an inequality.

lhs = `${parseInequality(input.latex).lhs}`
rhs = `${parseInequality(input.latex).rhs}`"
▶ 메모의 내용(content)은 "Enter an inequality."(부등식을 입력하시오.) 다음에 빈 줄을 두고 "lhs = `${parseInequality(input.latex).lhs}`", 그 다음 줄에 "rhs = `${parseInequality(input.latex).rhs}`"를 붙인 글로 한다.
parseInequality(latex)는 latex 글자(예: "2x+y>1")를 받아 부등식(inequality) 객체를 돌려주며 복합 부등식은 알아보지 못하고, lhs와 rhs는 방정식(부등식)의 좌변과 우변의 latex 글자이다. ${ }는 글자 안에 변수의 값을 끼워 넣는 표기이고, content는 메모에 직접 적은 글을 덮어쓴다.

isStrict type:inequality:isStrict

엄밀한 부등식(크다/작다)이면 참, 엄밀하지 않은 부등식(이상/이하)이면 거짓.

원문(영어) 보기

True for strict inequality, False for non-strict inequality

# Creates a function by subtracting the lesser side
# of the inequality from the greater side.
▷ 부등식의 작은 쪽을 큰 쪽에서 빼서 함수를 만든다.
function(`f`): parseInequality(input.latex).differenceFunction(`x`,`y`)
▶ 그래프의 함수 f(function(`f`))는 parseInequality(input.latex).differenceFunction(`x`,`y`), 즉 입력한 부등식의 (큰 쪽) - (작은 쪽) 함수로 한다.
function("이름")은 simpleFunction()의 결과를 그래프에 정의된 변수에 정한다. 함수 이름 f를 백틱으로 감싸 적었으며, 백틱으로 감싼 글자는 latex 값이다. parseInequality(latex)는 latex 글자(예: "2x+y>1")를 받아 부등식(inequality) 객체를 돌려주며 복합 부등식은 알아보지 못한다.
# Creates a variable in the graph and sets it to 1 when the # inequality is strictly less than or greater than, and 0 # when the inequality is less than or equal to or greater than or # equal to. ▷ 그래프에 변수를 만들고, 부등식이 엄밀한 크다/작다이면 1로, 이상/이하(같음 포함)이면 0으로 정한다. number(`s_{trict}`): when parseInequality(input.latex).isStrict 1 otherwise 0 ▶ 그래프의 변수 s_{trict}(number(`s_{trict}`))는 parseInequality(input.latex).isStrict가 참이면 1, 아니면 0으로 한다.
number("이름")은 그래핑 계산기 안의 변수 값을 정한다. when은 조건을 차례로 확인해 처음 맞는 값을 쓴다.

isLeftGreater type:inequality:isLeftGreater

부등식이 어느 쪽을 가리키는가? "크다"와 "이상"이면 참.

원문(영어) 보기

Which way does the inequality point? True for "greater than" and "greater than or equal to"

# Create a variable for the inequality.
▷ 부등식으로 변수를 만든다.
inequality = parseInequality(this.latex)
▶ 변수 inequality는 parseInequality(this.latex), 즉 이 구성요소의 latex로 만든 부등식 객체로 한다.
parseInequality(latex)는 latex 글자(예: "2x+y>1")를 받아 부등식(inequality) 객체를 돌려주며, 복합 부등식은 알아보지 못한다.
# Uses isLeftGreater to determine which of the two # sides is greater than the other. If the left Is Greater, # bigger is set to the left side and smaller is set to # the right side. If not, the assignments are switched. ▷ isLeftGreater로 두 변 중 어느 쪽이 더 큰지 알아낸다. 왼쪽이 더 크면 bigger는 왼쪽 변, smaller는 오른쪽 변으로 정하고, 아니면 반대로 정한다. bigger = when inequality.isLeftGreater inequality.lhs otherwise inequality.rhs ▶ 변수 bigger는 inequality.isLeftGreater가 참이면 좌변(inequality.lhs), 아니면 우변(inequality.rhs)으로 한다.
isLeftGreater는 부등식이 어느 쪽을 가리키는지를 알려 주며 "크다"와 "이상"이면 참이다.
smaller = when inequality.isLeftGreater inequality.rhs otherwise inequality.lhs ▶ 변수 smaller는 inequality.isLeftGreater가 참이면 우변(inequality.rhs), 아니면 좌변(inequality.lhs)으로 한다.

differenceFunction type:inequality:differenceFunction

(큰 쪽) - (작은 쪽)을 나타내는 simpleFunction. 0과 같다고 놓고 검사하거나 그릴 때, 또 f(x,y)>0으로 쓸 만하다.

원문(영어) 보기

simpleFunction representing for (greater side) - (lesser side) of an equation. Useful for setting equal to zero to test or plot, with f(x,y)>0

# Creates a function by subtracting the lesser side
# of the inequality from the greater side.
▷ 부등식의 작은 쪽을 큰 쪽에서 빼서 함수를 만든다.
function(`f`): parseInequality(input.latex).differenceFunction(`x`,`y`)
▶ 그래프의 함수 f(function(`f`))는 parseInequality(input.latex).differenceFunction(`x`,`y`), 즉 입력한 부등식의 (큰 쪽) - (작은 쪽) 함수로 한다.
function("이름")은 simpleFunction()의 결과를 그래프에 정의된 변수에 정한다. 함수 이름 f를 백틱으로 감싸 적었으며, 백틱으로 감싼 글자는 latex 값이다. parseInequality(latex)는 latex 글자(예: "2x+y>1")를 받아 부등식(inequality) 객체를 돌려주며 복합 부등식은 알아보지 못한다.
# Creates a variable in the graph and sets it to 1 when the # inequality is strictly less than or greater than, and 0 # when the inequality is less than or equal to or greater than or # equal to. ▷ 그래프에 변수를 만들고, 부등식이 엄밀한 크다/작다이면 1로, 이상/이하(같음 포함)이면 0으로 정한다. number(`s_{trict}`): when parseInequality(input.latex).isStrict 1 otherwise 0 ▶ 그래프의 변수 s_{trict}(number(`s_{trict}`))는 parseInequality(input.latex).isStrict가 참이면 1, 아니면 0으로 한다.
number("이름")은 그래핑 계산기 안의 변수 값을 정한다. when은 조건을 차례로 확인해 처음 맞는 값을 쓴다.