Tags
- LSL_Script
- 우수한 프런트 개발자
- UI/UX Engineer
- 프런트엔드
- postman excel
- emplace_back
- Intellij
- postman csv
- postman automations
- solidity
- Java
- Interaction developer
- web developer
- postman pre-request
- Android/iOS Developer
- Unity
- Android
- oracle
- postman collection variables
- MFC
- c#
- PL/SQL
- postman html parse
- postman
- postman tests
- postman collection
- 좋은 개발자
- Front-end developer
- C++
- postman session
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Archives
- Today
- Total
david's daily developer note
C# 두 벡터 내적 계산. 본문
728x90
두 벡터 (1, 0) , (0, 1)이 있다고 할 때, 아래의 벡터 특성으로~ 두 벡터간의 내적을 구할 수 있다.
다음은 위 수식을 C#으로 구현한 코드이다.
Vector v1 = new Vector(0, 1);
Vector v2 = new Vector(1, 0);
double leftExpression = v1.X * v2.X + v1.Y * v2.Y;
double theta = leftExpression /
( Math.Sqrt(Math.Pow(v1.X, 2) + Math.Pow(v1.Y, 2)) * Math.Sqrt(Math.Pow(v2.X, 2) + Math.Pow(v2.Y, 2)) );
double innerD = (double)(Math.Acos(theta) * (180 / Math.PI));
결괏값 90 잘나온당
728x90