From 6687052c3c7dc72720fbc98c990f1c688b3afde9 Mon Sep 17 00:00:00 2001 From: wooooooood <13pft13@gmail.com> Date: Sun, 22 May 2022 23:01:04 +0900 Subject: [PATCH 1/2] :pencil2: Introduction to BODMAS --- .../nicky/1 Introduction and Arithmetic.md | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 01_Math_For_Video_Games/nicky/1 Introduction and Arithmetic.md diff --git a/01_Math_For_Video_Games/nicky/1 Introduction and Arithmetic.md b/01_Math_For_Video_Games/nicky/1 Introduction and Arithmetic.md new file mode 100644 index 0000000..f371b1f --- /dev/null +++ b/01_Math_For_Video_Games/nicky/1 Introduction and Arithmetic.md @@ -0,0 +1,67 @@ +# 1. 환영 인사 + +**5 Keys to success** + +- Ask a lot +- Immediately practice every concept +- beauty of math +- challenge each other +- feedback + +# 2. 덧셈과 뺄셈 + +- **개발 과정에서 고려해야 하는 것** + 1. `overflow` : 32bit number이 가질 수 있는 값을 넘지 않도록 + 2. `type` : +/-할 때 오른쪽 숫자가 whole number(정수)인지 decimal(십진수)일지 등의 숫자 타입 유의 + 3. `+` : 기능이 많기 때문에 가끔 문서를 보거나 기능을 override해야 할 수도 있다. 주의! +- +는 순서가 상관없지만 -는 순서가 의미 있다. + +# 3. 어림수 + +- Rounding/Floor/Ceiling +- `9.99`를 소수점 첫째 자리까지 반올림하면 `10.0`이라고 분명하게 작성하자 +- 항상 계산의 마지막에 Round하자! +- Math Library가 있어서 편하게 사용한다. + +``` +Challenge +6.283 +Floor: 6, 6.2, 6.28 +Ceiling: 7, 6.3, 6.29 +``` + +# 4. 곱셈과 숫자 블록 + +- `- * -` => `+` +- 4분면에 블록쌓는것처럼 그림을 그려서도 확인할 수 있다 + +# 5. 나눗셈 Division + +- 나눗셈을 반대로 하면 다른 결과가 나온다, 즉 순서가 중요하다 +- With `-`, order matters, affects SIGN +- With `/`, order matters, affects SIZE +- Don't devide by 0 +- 어떤 컴퓨터에서는 /가 \*보다 느릴 수 있으므로 속도가 중요하면 고려해야 한다 +- -, \* => may run out of range +- - => may run out of precision + +# 6. Remainders + +- 게임에서 내려지는 결정에 사용할 수 있다 + - ex. 랜덤 숫자를 2로 나누어 나머지가 0인지 1인지에 따라 턴을 준다 + +# 7. BODMAS + +- 컴퓨터에서 입력할때는 컴퓨터 형식에 맞게 작성한다 (나누기 모양은 /, 곱하기는 생략하지 않고 \*) +- 프로그램에 따라 연산 우선순위가 다를 수 있다. + - B: Brackets first / P: Parentheses(괄호) first + - O: Order / I: Indices / E: Expoonents + - D: Division / M: Multiplication + - M: Multiplication / D: Division + - A: Addition + - S: Subtraction +- 대부분의 시스템은 곱셈보다 나눗셈을 먼저 한다 (BODMAS) + +``` +Quiz 1 complete +``` From 057a2e789ceb4db76a2b9a37f94e52a67c98de0d Mon Sep 17 00:00:00 2001 From: wooooooood <13pft13@gmail.com> Date: Mon, 6 Jun 2022 22:41:49 +0900 Subject: [PATCH 2/2] :pencil2: 1-8. Squaring, Cubing, Power --- .../nicky/1 Introduction and Arithmetic.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/01_Math_For_Video_Games/nicky/1 Introduction and Arithmetic.md b/01_Math_For_Video_Games/nicky/1 Introduction and Arithmetic.md index f371b1f..9f42783 100644 --- a/01_Math_For_Video_Games/nicky/1 Introduction and Arithmetic.md +++ b/01_Math_For_Video_Games/nicky/1 Introduction and Arithmetic.md @@ -65,3 +65,11 @@ Ceiling: 7, 6.3, 6.29 ``` Quiz 1 complete ``` + +# 8. Squaring, Cubing(세제곱), Power(거듭제곱) +- `exponentiation` +- 제곱의 유용성: dealt with areas +- Cubing세제곱: 3 dimension +_🧐 Math.Pow에서 Pow가 Power의 약자였구나_ +- 2^24 => 24bit color system +