# data[].attributes.body
#define NOMINMAX
#include <iostream>
#define _USE_MATH_DEFINES
#include <cmath>
#include "core.h"
using namespace cyclone;
int main()
{
    Vector3 a(1, 2, -1);
    Vector3 b(3, 0, 2);

    Vector3 a1 = a;
    a1.normalise();

    Vector3 a3 = a.cross(b);
    a3.normalise();

    Vector3 a2 = a3.cross(a1);


    std::cout << a1.toString() << std::endl;
    std::cout << a2.toString() << std::endl;
    std::cout << a3.toString() << std::endl;

}

# data[].attributes.body
#define NOMINMAX
#include <iostream>
#define _USE_MATH_DEFINES
#include <cmath>
#include "core.h"
using namespace cyclone;
int main()
{
    Vector3 a(0, 0, 10);
    Vector3 b(0, 0, 3);

    Vector3 a1(5, 0, 5);
    Vector3 a2(-5, 0, 5);

    Vector3 v1 = a - b;
    Vector3 v2 = a1 - b;
    Vector3 v3 = a2 - b;

    Vector3 c = v1.cross(v2);
    Vector3 d = v1.cross(v3);

    std::cout << c.toString() << std::endl;
    std::cout << d.toString() << std::endl;

}

# data[].attributes.body
#define NOMINMAX
#include <iostream>
#include <cmath>
#include "core.h"

int main()
{
  cyclone::Vector3 firstVector(1, 2, -1);
  cyclone::Vector3 secondVector(3, 0, 2);
  firstVector.normalise();

  cyclone::Vector3 thirdVector = firstVector.cross(secondVector);

  if(secondVector.magnitude() == 0){
    return 0;
  }

  thirdVector.normalise();
  secondVector = thirdVector.cross(firstVector);

  std::cout << firstVector.toString() << std::endl;
  std::cout << secondVector.toString() << std::endl;
  std::cout << thirdVector.toString() << std::endl;

  return 0;
}

# data[].attributes.body
#define NOMINMAX
#include <iostream>
#include <cmath>
#include "core.h"


int main()
{
  cyclone::Vector3 p1(0, 0, 3);
  cyclone::Vector3 p2(0,0, 10);
  cyclone::Vector3 p3(5, 0, 5);
  cyclone::Vector3 p4(-5, 0, 5);

  cyclone::Vector3 k1 = p2 - p1;
  cyclone::Vector3 k2 = p3 - p1;
  cyclone::Vector3 k3 = p4 - p1;

  cyclone::Vector3 n1 = k1.cross(k2);
  cyclone::Vector3 n2 = k1.cross(k3);

  std::cout << n1.toString() << std::endl;
  std::cout << n2.toString() << std::endl;

  return 0;

  cyclone::Matrix4  m;

}

# data[].attributes.body
#define NOMINMAX

#define USEMATH_DEFINES

#include <iostream>

#include <cmath>

#include "core.h"

using namespace cyclone;

int main()

{

Vector3 a(1, 2, -1);

Vector3 b(3, 0, 2);

Vector3 c = a.cross(b);

a.normalise();

if (c.magnitude() == 0) {

return 0;}

else

{

c.normalise();

b = c.cross(a);

}

std::cout << a.toString() << std::endl;

std::cout << b.toString() << std::endl;

std::cout << c.toString() << std::endl;

return 0;

}

# data[].attributes.body
#define NOMINMAX

#define USEMATH_DEFINES

#include <iostream>

#include <cmath>

#include "core.h"

using namespace cyclone;

int main()

{

//현재 위치(0, 0, 3)

Vector3 n(0, 0, 3);

//목표 위치(0, 0, 10)

Vector3 g(0, 0, 10);

//적 1 위치(5, 0, 5)

Vector3 e1(5, 0, 5);

//적 2 위치(-5, 0, 5)

Vector3 e2(-5, 0, 5);

Vector3 v1 = g - n;

Vector3 v2 = e1 - n;

Vector3 v3 = e2 - n;

Vector3 a = v1.cross(v2);

Vector3 b = v1.cross(v3);

std::cout << a.toString() << std::endl;

std::cout << b.toString() << std::endl;

}

# data[].attributes.body
	#define NOMINMAX
#define _USE_MATH_DEFINES
#include <iostream>
#include<cmath>
#include "core.h"

int main()
{
cyclone::Vector3 A(1, 2, -1);
	A.normalise();
	cyclone::Vector3 B(3, 0, 2);
	cyclone::Vector3 C = A.cross(B);
	if (C.magnitude() == 0)std::cout << "" << std::endl;
	else {
		C.normalise();
		B = C.cross(A);
	}
	std::cout << "A: " << A.toString() << std::endl;
	std::cout << "B: " << B.toString() << std::endl;
	std::cout << "C: " << C.toString() << std::endl;

	return 0;
}

# data[].attributes.body
#define NOMINMAX
#define _USE_MATH_DEFINES
#include <iostream>
#include<cmath>
#include "core.h"

int main()
{
	cyclone::Vector3 t1(5,0,5);
	cyclone::Vector3 t2(-5,0,5);
	cyclone::Vector3 tank(0,0,3);
	cyclone::Vector3 go(0,0,10);

	cyclone::Vector3 t1_tank=t1-tank;
	cyclone::Vector3 t2_tank=t2-tank;
	cyclone::Vector3 go_tank=go-tank;

	cyclone::Vector3 t1_cross=t1_tank.cross(go_tank);
	cyclone::Vector3 t2_cross=t2_tank.cross(go_tank);

	std::cout<<"t1 cross: "<<t1_cross.toString()<<std::endl<<"t2 cross: "<<t2_cross.toString()<<std::endl;
}

# data[].attributes.body
#define NOMINMAX

#include <iostream>

#define USEMATH_DEFINES

#include <cmath>

#include "core.h"

int main()

{

cyclone::Vector3 a(1, 2, -1);

cyclone::Vector3 b(3, 0, 2);

a.normalise();

cyclone::Vector3 c = a.cross(b);

if(c.magnitude() == 0) {}

c.normalise();

b = c.cross(a);

std::cout << a.toString() << std::endl;

std::cout << b.toString() << std::endl;

std::cout << c.toString() << std::endl;

}

# data[].attributes.body
#define NOMINMAX

#define USEMATH_DEFINES

#include <cmath>

#include <iostream>

#include "core.h"

using namespace std;

int main()

{

cyclone::Vector3 a(1, 2, -1);

cyclone::Vector3 b(3, 0, 2);

a.normalise();

cyclone::Vector3 c = a.cross(b);

if (!(c.magnitude() == 0))

{

c.normalise();

b = c.cross(a);

}

cout << a.toString() << endl << b.toString() << endl << c.toString() << endl;

return 0;

}

# data[].attributes.body
#include <iostream>

#define USEMATH_DEFINES

#include <cmath>

#include "core.h"

int main()

{

cyclone::Vector3 a(1, 2, -1);

cyclone::Vector3 b(3, 0, 2);

a.normalise();

cyclone::Vector3 c = a.cross(b);

if (c.magnitude() == 0)

return 0;

c.normalise();

b = c.cross(a);

std::cout << a.toString() << std::endl;

std::cout << b.toString() << std::endl;

std::cout << c.toString() << std::endl;

return 0;

}

# data[].attributes.body
#include <iostream>

#include "core.h"

int main()

{

cyclone::Vector3 A(1, 2, -1); //기준 벡터

cyclone::Vector3 B(3, 0, 2);

A.normalise();

cyclone::Vector3 C = A.cross(B);

if (C.magnitude() == 0) {} //a와 b는 평행

else {

C.normalise();

B = C.cross(A);

}

std::cout << A.toString() << std::endl;

std::cout << B.toString() << std::endl;

std::cout << C.toString() << std::endl;

return 0;

}

# data[].attributes.body
#include <iostream>
#include "core.h"
#include <cmath>
using namespace std;
using namespace cyclone;

int main()
{
	cyclone::Vector3 A(1, 2, -1);
	cyclone::Vector3 B(3, 0, 2);
	A.normalise();
	B.normalise();
	cyclone::Vector3 C;
	C = A.cross(B);

	if (C.magnitude() == 0)
	{

	}
	else
	{
		C.normalise();
		B = C.cross(A);
	}

	cout << A.toString() << endl;
	cout << B.toString() << endl;
	cout << C.toString() << endl;
}

# data[].attributes.body
// class 3 by XERONAME

#define USEMATH_DEFINES

#include <iostream>

#include "core.h"

void printGreeting(void)

{ std::cout << "5820658 전형진\n"; }

// print answer

void printAnswer(std::string idx_problem, std::string answer)

{ std::cout << idx_problem << " 정답: " << answer; }

// print new line

void printNL(void) { std::cout << "\n"; }

// program entry point

int main(void) {

// ==== class 3-1 ====

cyclone::Vector3 u,v,r_1;

u = cyclone::Vector3(1,-2,-1);

v = cyclone::Vector3(-2,4,1);

r_1 = u.cross(v);

// ==== class 3-2 (tank game) ====

cyclone::Vector3 p_orig, p_targ, p_e1, p_e2, v_targ, v_e1, v_e2, r_2d1, r_2d2;

p_orig = cyclone::Vector3(0,0,3);

p_targ = cyclone::Vector3(0,0,10);

p_e1 = cyclone::Vector3(5,0,5);

p_e2 = cyclone::Vector3(-5,0,5);

// calculate the vectors

v_targ = (p_targ -p_orig);

v_e1 = (p_e1 -p_orig);

v_e2 = (p_e2 -p_orig);

// calculate the results (perform the cross-product)

r_2d1 = v_targ.cross(v_e1);

r_2d2 = v_targ.cross(v_e2);

// ==== class 3-3 ====

cyclone::Vector3 A, B, C, B_ret;

A = cyclone::Vector3(1,2,-1);

B = cyclone::Vector3(3,0,2);

C = A.cross(B);

B_ret = C.cross(A);

A.normalise();

B_ret.normalise();

C.normalise();

// ==== print answer ====

printGreeting();

printAnswer("정규직교기저 X", A.toString()); printNL();

printAnswer("정규직교기저 Y", B_ret.toString()); printNL();

printAnswer("정규직교기저 Z", C.toString());

return 0; // program end point

}

# data[].attributes.body
#define NOMINMAX

#define USEMATH_DEFINES

#include <cmath>

#include <iostream>

#include "core.h"

using namespace std;

int main()

{

cyclone::Vector3 A(1, 2, -1);

cyclone::Vector3 B(3, 0, 2);

A.normalise();

cyclone::Vector3 C = A.cross(B);

if (C.magnitude() == 0)

{

cout << "A와 B는 평행하다" << endl;

}

else

{

C.normalise();

B = C.cross(A);

}

cout << "A :" << A.toString() << endl;

cout << "B :" << B.toString() << endl;

cout << "C :" << C.toString() << endl;

# data[].attributes.body
#define NOMINMAX
#define _USE_MATH_DEFINES
#include <cmath>
#include <iostream>
#include "core.h"

int main()
{
	cyclone::Vector3 A(1, 2, -1);
	cyclone::Vector3 B(3, 0, 2);
	A.normalise();
	cyclone::Vector3 C = A.cross(B);
	if (C.squareMagnitude() == 0)
	{
		return 0;
	}
	else
	{
		C.normalise();
		B = C.cross(A);
	}

	std::cout << "A = " << A.toString() << std::endl;
	std::cout << "B = " << B.toString() << std::endl;
	std::cout << "C = " << C.toString() << std::endl;

	return 0;

}

# data[].attributes.body
#define NOMINMAX

#include <iostream>

#include "core.h"

#include <corecrt_math_defines.h>

int main()

{

cyclone::Vector3 A(1, 2, -1);

cyclone::Vector3 B(3, 0, 2);

cyclone::Vector3 C;

A.normalise();

C = A.cross(B);

if (C.magnitude() == 0)

{

std::cout << "A와 B는 평행입니다." << std::endl;

}

else

{

C.normalise();

B = C.cross(A);

}

//Orthonormal basis

std::cout << "A: " << A.toString() << std::endl;

std::cout << "B: " << B.toString() << std::endl;

std::cout << "C: " << C.toString() << std::endl;

return 0;

}

# data[].attributes.body
#define USEMATH_DEFINES

#include <cmath>

#include <iostream>

#include "core.h"

int main()

{

cyclone::Vector3 A(1, 2, -1);

cyclone::Vector3 B(3, 0, 2);

A.normalise();

cyclone::Vector3 C = A.cross(B);

if (C.magnitude() == 0)

{

std::cout << "A와 B는 평행합니다." << std::endl;

}

else

{

C.normalise();

B = C.cross(A);

}

std::cout << A.toString() << std::endl;

std::cout << B.toString() << std::endl;

std::cout << C.toString() << std::endl;

return 0;

}

# data[].attributes.body
#define NOMINMAX
#define _USE_MATH_DEFINES
#include <iostream>
#include <cmath>
#include "core.h"

using namespace cyclone;
using namespace std;


int main()
{
	Vector3 A(1, 2, -1);
	Vector3 B(3, 0, 2);

	Vector3 C = A.cross(B);

	A.normalise();

	if (C.magnitude() == 0)
	{
		return 0;
	}
	else
	{
		C.normalise();
		B = C.cross(A);
	}

	cout << A.toString() << B.toString() << C.toString() << endl;


	return 0;
}

# data[].attributes.body
#define NOMINMAX

#define USEMATH_DEFINES

#include <iostream>

#include <cmath>

#include "core.h"

int main() {

cyclone::Vector3 a(1, 2, -1);

cyclone::Vector3 b(3, 0, 2);

a.normalise();

cyclone::Vector3 c = a.cross(b);

if (c.magnitude() == 0) {

return 0;

}

else {

c.normalise();

b = c.cross(a);

}

std::cout << "A: " << a.toString() << std::endl;

std::cout << "B: " << b.toString() << std::endl;

std::cout << "C: " << c.toString() << std::endl;

return 0;

}

# data[].attributes.body
#define NOMINMAX

#include <iostream>

#include "core.h"

int main()

{

cyclone::Vector3 a(1, 2, -1);

cyclone::Vector3 b(3, 0, 2);

a.normalise();

cyclone::Vector3 c = a.cross(b);

if (c.magnitude() == 0) {

std::cout << "a와 b는 평행하다" << std::endl;

return 0;

}

else {

c.normalise();

b = c.cross(a);

}

std::cout << a.toString() << std::endl;

std::cout << b.toString() << std::endl;

std::cout << c.toString() << std::endl;

return 0;

}

# data[].attributes.body
#define USEMATH_DEFINES

#include <iostream>

#include <cmath>

#include "core.h"

using namespace std;

using namespace cyclone;

int main()

{

Vector3 A = Vector3(1, 2, -1);

Vector3 B = Vector3(3, 0, 2);

A.normalise();

Vector3 C = A.cross(B);

if (C.magnitude() == 0) { return 0; }

else

{

C.normalise();

B = C.cross(A);

}

cout << A.toString() << endl;

cout << B.toString() << endl;

cout << C.toString() << endl;

return 0;

}

# data[].attributes.body
#define NOMINMAX
#include <iostream>
#include <cmath>
#include "core.h"
using namespace cyclone;

int main()
{
	Vector3 A(1, 2, -1);
	Vector3 B(3, 0, 2);

	A.normalise();

	Vector3 C = A.cross(B);

	if(C.magnitude()==0){}
	else {
		C.normalise();
		B = C.cross(A);

		std::cout << A.toString() << std::endl;
		std::cout << B.toString() << std::endl;
		std::cout << C.toString() << std::endl;
	}
}

# data[].attributes.body
#define NOMINMAX

#define USEMATH_DEFINES

#include <cmath>

#include <core.h>

#include <iostream>

#include "core.h"

using namespace cyclone;

int main()

{

Vector3 A(1, 2, -1);

Vector3 B(3, 0, 2);

A.normalise();

Vector3 C = A.cross(B);

if (C.magnitude() == 0){}

else

{

C.normalise();

B = C.cross(A);

}

std::cout << A.toString() + "\n" << B.toString() + "\n" << C.toString() + "\n" << std::endl;

}

# data[].attributes.body
#define NOMINMAX
#include <iostream>
#define _USE_MATH_DEFINES
#include <cmath>
#include "core.h"

int main()
{
	cyclone::Vector3 a(1, 2, -1);
	cyclone::Vector3 b(3, 0, 2);
	a.normalise();
	cyclone::Vector3 c = a % b;
	if (c.magnitude() == 0) {
		return 0;
	}
	c.normalise();
	b = c % a;
	std::cout << "a: " << a.toString() << std::endl;
	std::cout << "b: " << b.toString() << std::endl;
	std::cout << "c: " << c.toString() << std::endl;
}

# data[].attributes.body
#include <iostream>

#define NOMINMAX

#define USEMATH_DEFINES

#include <cmath>

#include "core.h"

using namespace cyclone;

using namespace std;

int main()

{

Vector3 a(1, 2, -1);

Vector3 b(3, 0, 2);

a.normalise();

Vector3 c = a.cross(b);

if (c.magnitude() == 0)

{

return 0;

}

c.normalise();

b = c.cross(a);

cout << a.toString() << "\n" << b.toString() << "\n" << c.toString();

}

# data[].attributes.body
#define NOMINMAX

#define USEMATH_DEFINES

#include <cmath>

#include <iostream>

#include "core.h"

int main()

{

cyclone::Vector3 a(1, 2, -1);

cyclone::Vector3 b(3, 0, 2);

a.normalise();

cyclone::Vector3 c = a.cross(b);

if (c.magnitude() == 0) { return 0; }

else{

c.normalise();

b = c.cross(a);

}

std::cout << a.toString() << std::endl;

std::cout << b.toString() << std::endl;

std::cout << c.toString() << std::endl;

return 0;

}

# data[].attributes.body
#define NOMINMAX
#include <iostream>
#include "core.h"

#include <string>
#include <vector>

using namespace std;


int main()
{
	cyclone::Vector3 a(1, 2, -1);
	cyclone::Vector3 b(3, 0, 2);

	//벡터 a 가 기준
	//1.a를 정규화
	a.normalise();
	//2.외적
	cyclone::Vector3 c = a.cross(b);
	//3. a와 b가 평행이 아닐경우
	if (c.magnitude() != 0)
	{
		c.normalise();
		b = c.cross(a);
	}

	std::cout << "Vector A : " << a.toString() << '\n';
	std::cout << "Vector B : " << b.toString() << '\n';
	std::cout << "Vector C : " << c.toString() << '\n';

    return 0;
}

# data[].attributes.body
#define NOMINMAX
#include <iostream>
#include <cmath>
#include "core.h"

// 벡터사이간의 각도 : a*b 내적 / sqrt(a^2) * sqrt(b^2) 길이

int main()
{
  cyclone::Vector3 v1(1, 2, -1);
  cyclone::Vector3 v2(3, 0, 2);
  v1.normalise();
  cyclone::Vector3 v3 = v1.cross(v2);
  if(v2.magnitude() == 0){
    return 0;
  }
  v3.normalise();
  v2 = v3.cross(v1);
  std::cout << v1.toString() << std::endl;
  std::cout << v2.toString() << std::endl;
  std::cout << v3.toString() << std::endl;

  return 0;

}

# data[].attributes.body
#include

#include

#include "core.h"

using namespace cyclone;

int main()

{

Vector3 A(1, 2, -1);

Vector3 B(3, 0, 2);

// 정규직교기저 구하기

A.normalise();

Vector3 C = A.cross(B);

if (C.magnitude() == 0)

{

std::cout << "A와 B는 평행하다." << std::endl;

}

else

{

C.normalise();

B = C.cross(A);

}

std::cout << "A (Orthonormal basis vector) : " << A.toString() << std::endl;

std::cout << "B (Orthonormal basis vector) : " << B.toString() << std::endl;

std::cout << "C (Orthonormal basis vector) : " << C.toString() << std::endl;

return 0;

}

# data[].attributes.body
#include <iostream>
#include "core.h"
using namespace cyclone;
int main()
{
	Vector3 A(1, 2, -1);
	Vector3 B(3, 0, 2);
	A.normalise();
	Vector3 C = A.cross(B);

	if(C.magnitude()==0)
	{
		std::cout<<"A and B are parallel."<<std::endl;
	}
	else
	{
		C.normalise();
		B = C.cross(A);

		std::cout << "Orthonormal basis: " << std::endl;
		std::cout << A.toString() << std::endl;
		std::cout << B.toString() << std::endl;
		std::cout << C.toString() << std::endl;
	}
}

# data[].attributes.body
#define NOMINMAX

#include <iostream>

#include <core.h>

int main()

{

cyclone::Vector3 A(1, 2, -1);

cyclone::Vector3 B(3, 0, 2);

cyclone::Vector3 e1 = A;

e1.normalise();

cyclone::Vector3 e3 = A.cross(B);

e3.normalise();

cyclone::Vector3 e2 = e3.cross(e1);

std::cout << "e1: " << e1.toString() << std::endl;

std::cout << "e2: " << e2.toString() << std::endl;

std::cout << "e3: " << e3.toString() << std::endl;

return 0;

}

# data[].attributes.body
#define NOMINAX

#include <iostream>

#define USEMATH_DEFINES

#include <cmath>

#include "core.h"

int main()

{

//정규직교기저 구하기

cyclone::Vector3 A(1, 2, -1);

cyclone::Vector3 B(3, 0, 2);

A.normalise();

cyclone::Vector3 C = A.cross(B);

if (C.magnitude() == 0) {}

C.normalise();

B = C.cross(A);

std::cout << A.toString() << std::endl;

std::cout << B.toString() << std::endl;

std::cout << C.toString() << std::endl;

}

# data[].attributes.body
#define USEMATH_DEFINES

#define NOMINMAX

#include <iostream>

#include "core.h"

#include <cmath>

int main()

{

cyclone::Vector3 A(1, 2, -1);

cyclone::Vector3 B(3, 0, 2);

A.normalise();

cyclone::Vector3 C = A.cross(B);

if (C.magnitude() == 0) {

std::cout << "a와 b는 평행" << std::endl;

}

else {

C.normalise();

B = C.cross(A);

std::cout << A.toString() << std::endl;

std::cout << B.toString() << std::endl;

std::cout << C.toString() << std::endl;

}

return 0;

}

# data[].attributes.body
#include <iostream>

#include "core.h"

int main()
{
	cyclone::Vector3 A(1, 2, -1);
	cyclone::Vector3 B(3, 0, 2);
	A.normalise();
	cyclone::Vector3 C = A.cross(B);
	if (C.magnitude() != 0) {
		C.normalise();
		B = C.cross(A);
		std::cout << A.toString() << std::endl;
		std::cout << B.toString() << std::endl;
		std::cout << C.toString() << std::endl;
	}
	return 0;
}

# data[].attributes.body
#include <iostream>
#define _USE_MATH_DEFINES
#include <cmath>
#include "core.h"
using namespace cyclone;
int main()
{
	const double DEGREES_TO_RADIAN = M_PI / 180.0f;
	const double RADIANS_TO_DEGREES = 180.0f / M_PI;
	Vector3 p(0, 0, 3);
	Vector3 a(0, 0, 10);
	Vector3 b1(5, 0, 5);
	Vector3 b2(-5, 0, 5);
	a -= p;
	b1 -= p;
	b2 -= p;
	float c1 = a.dot(b1);
	float c2 = a.dot(b2);
	float d1 = c1 / (a.magnitude() * b1.magnitude());
	float d2 = c2 / (a.magnitude() * b2.magnitude());
	double deg1 = acos(d1) * RADIANS_TO_DEGREES;
	double deg2 = acos(d2) * RADIANS_TO_DEGREES;
	Vector3 corss1 = a.cross(b1);
	Vector3 corss2 = a.cross(b2);
	std::cout << "the angle between a and b1 is " << deg1 << std::endl;
	std::cout << "a x b1 is " << corss1.toString() << std::endl;
	std::cout << "the angle between a and b2 is " << deg2 << std::endl;
	std::cout << "a x b2 is " << corss2.toString() << std::endl;
}

# data[].attributes.body
#define _USE_MATH_DEFINES
#include <iostream>
#include "..\Cyclone\core.h"
#include<cmath>


int main()
{
   cyclone::Vector3 A(1,2,-1);
   A.normalise();
   cyclone::Vector3 B(3,0,2);
   cyclone::Vector3 C = A.cross(B);

   if(C.magnitude() == 0) {return 0;}

   C.normalise();
   B = C.cross(A);

   std::cout<<"A: "<< A.toString()<<std::endl;
   std::cout<<"B: "<< B.toString()<<std::endl;
   std::cout<<"C: "<< C.toString()<<std::endl;
}

# data[].attributes.body
#define NOMINMAX

#include <iostream>

#include <cmath>

#include "core.h"

using namespace cyclone;

int main()

{

Vector3 target_point(0, 0, 10);

Vector3 current_point(0, 0, 3);

Vector3 enemy_point(-5, 0, 5);

Vector3 enemy_point2(5, 0, 5);

// target_point와 enemy_point 사이의 벡터 계산

Vector3 v1 = enemy_point - target_point;

// 기준 벡터

Vector3 v2 = current_point - target_point;

// target_point와 enemy_point2 사이의 벡터 계산

Vector3 v3 = enemy_point2 - target_point;

// 외적을 이용하여 방향 계산

Vector3 cross_product = v2.cross(v1);

Vector3 cross_product2 = v2.cross(v3);

std::cout << cross_product.toString() << ", " << cross_product2.toString() << std::endl;

return 0;

}

# data[].attributes.body
#define NOMINMAX
#define _USE_MATH_DEFINES
#include <cmath>
#include <iostream>
#include "core.h"

int main()
{
	const double DEGREES_TO_RADIAN = M_PI / 180.0f;
	const double RADIANS_TO_DGREES = 180.0f / M_PI;
	cyclone::Vector3 a(0, 0, 3);	// 현재위치
	cyclone::Vector3 b(5, 0, 5);	// 적위치
	cyclone::Vector3 c(-5, 0, 5);	// 적위치
	cyclone::Vector3 d(0, 0, 10);	// 목표위치

	cyclone::Vector3 ad = d - a;	// 현재위치 - 목표위치
	cyclone::Vector3 ab = b - a;	// 현재위치 - 적위치
	cyclone::Vector3 ac = c - a;	// 현재위치 - 적위치

	cyclone::Vector3 u = ad.cross(ab);
	cyclone::Vector3 v = ad.cross(ac);
	std::cout << u.toString() << std::endl;
	std::cout << v.toString() << std::endl;

	return 0;

}

# data[].attributes.body
#define NOMINMAX

#include <iostream>

#define USEMATH_DEFINES

#include <cmath>

#include "core.h"

int main()

{

cyclone::Vector3 a(0, 0, 10);

cyclone::Vector3 b(0, 0, 3);

cyclone::Vector3 c(5, 0, 5);

cyclone::Vector3 d(-5, 0, 5);

cyclone::Vector3 v1 = a - b;

cyclone::Vector3 v2 = c - b;

cyclone::Vector3 v3 = d - b;

cyclone::Vector3 d1 = v1.cross(v2);

cyclone::Vector3 d2 = v1.cross(v3);

std::cout << d1.toString() << std::endl;

std::cout << d2.toString() << std::endl;

}

# data[].attributes.body
#define NOMINMAX

#define USEMATH_DEFINES

#include <cmath>

#include <iostream>

#include "core.h"

using namespace std;

int main()

{

// 포 현재위치

cyclone::Vector3 v1(0, 0, 3);

// 포 목표위치

cyclone::Vector3 v2(0, 0, 10);

// 적1 위치

cyclone::Vector3 e1(5, 0, 5);

// 적2 위치

cyclone::Vector3 e2(-5, 0, 5);

//현재벡터

cyclone::Vector3 v3 = v2 - v1;

//목표벡터1

cyclone::Vector3 ob1 = e1 - v1;

//목표벡터2

cyclone::Vector3 ob2 = e2 - v1;

cyclone::Vector3 v4 = v3.cross(ob1);

cyclone::Vector3 v5 = v3.cross(ob2);

cout << v4.toString() << endl << v5.toString() << endl;

//포의 회전 각도 세타?

const double DEGREES_TO_RADIAN = M_PI / 180.0f;

const double RADIANS_TO_DEGREES = 180.0f / M_PI;

float d = v3.dot(ob2);

float c = d / (v3.magnitude() * ob2.magnitude());

double deg = acos(c) * RADIANS_TO_DEGREES;

cout << deg << endl;

return 0;

}

# data[].attributes.body
#define NOMINMAX
#include <iostream>
#include "core.h"

#include <string>
#include <vector>

using namespace std;


int main()
{
	//내 위치
	cyclone::Vector3 p(0, 0, 3);

	cyclone::Vector3 p1(0, 0, 10);
	//오른쪽 적 위치
	cyclone::Vector3 p2(5, 0, 5);
	//왼쪽 적 위치
	cyclone::Vector3 p3(-5, 0, 5);

	//현재 바라 보는 방향
	cyclone::Vector3 v = p1 - p;
	//오른쪽 적 방향
	cyclone::Vector3 v1 = p2 - p;
	//왼쪽 적 방향
	cyclone::Vector3 v2 = p3 - p;


	std::cout <<"오른쪽 벡터의 외적 : " + v.cross(v1).toString() << '\n';
	std::cout << "왼쪽 벡터의 외적 : " + v.cross(v2).toString() << '\n';


    return 0;


}

# data[].attributes.body
#include <iostream>
#include "core.h"
using namespace cyclone;
using namespace std;

int main()
{
    cyclone::Vector3 a(0, 0, 10);
    cyclone::Vector3 b(0, 0, 3);
    cyclone::Vector3 c(5, 0, 5);
    cyclone::Vector3 d(-5, 0, 5);
    cyclone::Vector3 A = a - b;
    cyclone::Vector3 B = c - b;
    cyclone::Vector3 C = d - b;

    cyclone::Vector3 O = A.cross(B);
    cyclone::Vector3 P = A.cross(C);

    cout << O.toString() << endl;
    cout << P.toString() << endl;
}

# data[].attributes.body
#define NOMINAX

#include <iostream>

#define USEMATH_DEFINES

#include <cmath>

#include "core.h"

int main()

{

cyclone::Vector3 startp(0,0,3);

cyclone::Vector3 u(0,0,10);

cyclone::Vector3 a(5, 0, 5);

cyclone::Vector3 b(-5, 0, 5);

cyclone::Vector3 ptou = u - startp;

cyclone::Vector3 ptoa = a - startp;

cyclone::Vector3 ptob = b - startp;

cyclone::Vector3 sum1 = ptou.cross(ptoa);

cyclone::Vector3 sum2 = ptou.cross(ptob);

std::cout << sum1.toString() << std::endl;

std::cout << sum2.toString() << std::endl;

}

# data[].attributes.body
// class 3 by XERONAME

#define USEMATH_DEFINES

#include <iostream>

#include "core.h"

const double DEG_TO_RAD = (M_PI /180.0f);

const double RAD_TO_DEG = (180.0f /M_PI);

void printGreeting(void)

{ std::cout << "5820658 전형진\n"; }

// print answer

void printAnswer(std::string idx_problem, std::string answer)

{ std::cout << "문제 " << idx_problem << " 정답: " << answer; }

// print new line

void printNL(void) { std::cout << "\n"; }

// program entry point

int main(void) {

// ==== class 3-1 ====

cyclone::Vector3 u,v,r_1;

u = cyclone::Vector3(1,-2,-1);

v = cyclone::Vector3(-2,4,1);

r_1 = u.cross(v);

// ==== class 3-2 (tank game) ====

cyclone::Vector3 p_orig, p_targ, p_e1, p_e2, v_targ, v_e1, v_e2, r_2d1, r_2d2;

p_orig = cyclone::Vector3(0,0,3);

p_targ = cyclone::Vector3(0,0,10);

p_e1 = cyclone::Vector3(5,0,5);

p_e2 = cyclone::Vector3(-5,0,5);

// calculate the vectors

v_targ = (p_targ -p_orig);

v_e1 = (p_e1 -p_orig);

v_e2 = (p_e2 -p_orig);

// calculate the results (perform the cross-product)

r_2d1 = v_targ.cross(v_e1);

r_2d2 = v_targ.cross(v_e2);

// ==== print answer ====

printGreeting();

printAnswer("탱크 게임 1번", r_2d1.toString());

printNL();

printAnswer("탱크 게임 2번", r_2d2.toString());

return 0; // program end point

}

# data[].attributes.body
#define NOMINMAX

#define USEMATH_DEFINES

#include <cmath>

#include <iostream>

#include "core.h"

using namespace std;

int main()

{

const double DEGRESS_TO_RADIAN = M_PI / 180.0f;

const double RADIANS_TO_DEGRESS = 180.0f / M_PI;

cyclone::Vector3 a(0, 0, 3); //현재 위치

cyclone::Vector3 b(0, 0, 10); //목표 위치

cyclone::Vector3 c(5, 0, 5); //적 위치

cyclone::Vector3 c2(-5, 0, 5); //적 위치2

cyclone::Vector3 d = b - a;

cyclone::Vector3 e = c - a;

cyclone::Vector3 e2 = c2 - a;

cyclone::Vector3 f = d.cross(e);

cyclone::Vector3 g = d.cross(e2);

cout << "(5, 0, 5) 포탑 각 : " << f.toString() << endl;

cout << "(-5, 0, 5) 포탑 각 : " << g.toString() << endl;

# data[].attributes.body
#define NOMINMAX
#include <iostream>
#include <cmath>
#include "core.h"

// 벡터사이간의 각도 : a*b 내적 / sqrt(a^2) * sqrt(b^2) 길이

int main()
{
  cyclone::Vector3 p1(0, 0, 3);
  cyclone::Vector3 p2(0,0, 10);
  cyclone::Vector3 p3(5, 0, 5);
  cyclone::Vector3 p4(-5, 0, 5);

  cyclone::Vector3 v1 = p2 - p1;
  cyclone::Vector3 v2 = p3 - p1;
  cyclone::Vector3 v3 = p4 - p1;

  cyclone::Vector3 c1 = v1.cross(v2);
  cyclone::Vector3 c2 = v1.cross(v3);
  std::cout << c1.toString() << "|" << c2.toString() << std::endl;

  return 0;

  cyclone::Matrix4  m;

}

# data[].attributes.body
#define NOMINMAX
#include <iostream>
#define _USE_MATH_DEFINES
#include <cmath>
#include "core.h"

int main()
{
	cyclone::Vector3 origin(0, 0, 3); //원점
	cyclone::Vector3 start(0, 0, 10); //최초위치
	cyclone::Vector3 a(5, 0, 5); //우측 적
	cyclone::Vector3 b(-5, 0, 5); //좌측 적

	cyclone::Vector3 v0 = start - origin; //최초 위치로의 벡터
	cyclone::Vector3 v1 = a - origin; //우측 적으로의 벡터
	cyclone::Vector3 v2 = b - origin; //좌측 적으로의 벡터

	const float RADIAN_TO_DEGREE = 180.0f / M_PI;
	std::cout << "angle between v0 and v1: " << acos(v0.dot(v1)/v0.magnitude()/v1.magnitude()) * RADIAN_TO_DEGREE << std::endl;
	std::cout << "angle between v0 and v2: " << acos(v0.dot(v2)/v0.magnitude()/v2.magnitude()) * RADIAN_TO_DEGREE << std::endl;
	std::cout << std::endl;
	std::cout << "v0 cross v1: " << v0.cross(v1).toString() << std::endl;
	std::cout << "v0 cross v2: " << v0.cross(v2).toString() << std::endl;
}

# data[].attributes.body
#define NOMINMAX

#define USEMATH_DEFINES

#include <iostream>

#include <cmath>

#include "core.h"

int main() {

cyclone::Vector3 a(0, 0, 3);

cyclone::Vector3 b(0, 0, 10);

cyclone::Vector3 c(5, 0, 5);

cyclone::Vector3 d(-5, 0, 5);

cyclone::Vector3 v1 = b - a;

cyclone::Vector3 v2 = c - a;

cyclone::Vector3 v3 = d - a;

cyclone::Vector3 e = v1.cross(v2);

cyclone::Vector3 f = v1.cross(v3);

std::cout << e.toString() << std::endl;

std::cout << f.toString() << std::endl;

return 0;

}

# data[].attributes.body
#include <iostream>

#define NOMINMAX

#define USEMATH_DEFINES

#include <cmath>

#include "core.h"

using namespace cyclone;

using namespace std;

int main()

{

Vector3 A(0,0,10);

Vector3 T_1(5,0,5);

Vector3 T_2(-5,0,5);

Vector3 C (0, 0, 3);

Vector3 V1 = A - C;

Vector3 V2 = T_1 - C;

Vector3 V3 = T_2 - C;

Vector3 a1 = V1.cross(V2);

Vector3 a2 = V1.cross(V3);

cout << a1.toString() << "\n" << a2.toString() << endl;

}

# data[].attributes.body
#include <iostream>

#define USEMATH_DEFINES

#include <cmath>

#include "core.h"

int main()

{

cyclone::Vector3 p1(-5, 0, 5);

cyclone::Vector3 p2(5, 0, 5);

cyclone::Vector3 p3(0, 0, 3);

cyclone::Vector3 p4(0, 0, 10);

cyclone::Vector3 v1 = p2 - p3;

cyclone::Vector3 v2 = p1 - p3;

cyclone::Vector3 v3 = p4 - p3;

cyclone::Vector3 u1 = v3.cross(v1);

cyclone::Vector3 u2 = v3.cross(v2);

std::cout << u1.toString() << std::endl;

std::cout << u2.toString() << std::endl;

return 0;

}

# data[].attributes.body
#define USEMATH_DEFINES

#include <cmath>

#include <iostream>

#include "core.h"

int main()

{

cyclone::Vector3 A(0, 0, 3);

cyclone::Vector3 B(0, 0, 10);

cyclone::Vector3 C(5, 0, 5);

cyclone::Vector3 D(-5, 0, 5);

cyclone::Vector3 U = B - A;

cyclone::Vector3 V = C - A;

cyclone::Vector3 W = D - A;

cyclone::Vector3 E = U.cross(V);

cyclone::Vector3 F = U.cross(W);

std::cout << E.toString() << std::endl;

std::cout << F.toString() << std::endl;

return 0;

}

# data[].attributes.body
#include <iostream>

#define _USE_MATH_DEFINES
#include <cmath>

#include "core.h"

using namespace cyclone;
using namespace std;

int main()
{
	Vector3 U1(0, 0, 3);
	Vector3 U2(0, 0, 10);

	Vector3 V1(5, 0, 5);
	Vector3 V2(-5, 0, 5);

	Vector3 U = U2 - U1;
	Vector3 V = V2 - V1;
	Vector3 N = V2 - U1;

	Vector3 C = U.cross(V1);
	Vector3 D = U.cross(V2);

	cout << C.toString() << D.toString() << endl;

	return 0;
}

# data[].attributes.body
#include <iostream>

#define USEMATH_DEFINES

#include <cmath>

#include "core.h"

int main()

{

cyclone::Vector3 A(0, 0, 3);

cyclone::Vector3 B(0, 0, 10);

cyclone::Vector3 C(5, 0, 5);

cyclone::Vector3 D(-5, 0, 5);

cyclone::Vector3 v1 = B - A;

cyclone::Vector3 e1 = C - A;

cyclone::Vector3 e2 = D - A;

cyclone::Vector3 E1 = v1.cross(e1);

cyclone::Vector3 E2 = v1.cross(e2);

std::cout << E1.toString() << std::endl;

std::cout << E2.toString() << std::endl;

return 0;

}

# data[].attributes.body
#define NOMINMAX

#include <iostream>

#include <core.h>

int main()

{

cyclone::Vector3 A(5, 0, 2);

cyclone::Vector3 B(0, 0, 7);

cyclone::Vector3 C = A.cross(B);

std::cout << C.toString() << std::endl;

A = cyclone::Vector3 (-5, 0, 2);

B = cyclone::Vector3 (0, 0, 7);

C = A.cross(B);

std::cout << C.toString() << std::endl;

return 0;

}

# data[].attributes.body
#define NOMINMAX

#include <iostream>

#include "core.h"

int main()

{

//탱크게임 외적

cyclone::Vector3 a(-5, 0, 5);

cyclone::Vector3 b(5, 0, 5);

cyclone::Vector3 c(0, 0, 3);

cyclone::Vector3 d(0, 0, 10);

cyclone::Vector3 e = b - c;

cyclone::Vector3 f = a - c;

cyclone::Vector3 g = d - c;

cyclone::Vector3 u = g.cross(e);

cyclone::Vector3 v = g.cross(f);

std::cout << u.toString() << std::endl;

std::cout << v.toString() << std::endl;

return 0;

}

# data[].attributes.body
#include <iostream>

#include "core.h"

int main()
{
	cyclone::Vector3 p(0, 0, 3);
	cyclone::Vector3 v(0, 0, 10);
	cyclone::Vector3 u1(5, 0, 5);	//포의 오른쪽에 위치
	cyclone::Vector3 u2(-5, 0, 5);	//포의 왼쪽에 위치

	v -= p;
	u1 -= p;
	u2 -= p;

	//
	cyclone::Vector3 cross_vu1 = v.cross(u1);
	cyclone::Vector3 cross_vu2 = v.cross(u2);

	std::cout << "( " << cross_vu1.x << ", " << cross_vu1.y << ", " << cross_vu1.z << " )" << std::endl;
	std::cout << "( " << cross_vu2.x << ", " << cross_vu2.y << ", " << cross_vu2.z << " )" << std::endl;

	return 0;
}

# data[].attributes.body
#define NOMINMAX
#include <iostream>
#include "core.h"

int main()
{
	cyclone::Vector3 G(0, 0, 10);
	cyclone::Vector3 E1(-5, 0, 5);
	cyclone::Vector3 E2(5, 0, 5);
	cyclone::Vector3 P(0, 0, 3);

	cyclone::Vector3 PG = G - P; // PG 벡터
	cyclone::Vector3 PE1 = E1 - P; // PE1 벡터
	cyclone::Vector3 PE2 = E2 - P; // PE2 벡터

	cyclone::Vector3 A = PG.cross(PE1); // PG 벡터와 PE1 벡터의 외적
	cyclone::Vector3 B = PG.cross(PE2); // PG 벡터와 PE2 벡터의 외적

	std::cout <<"left = " << A.toString() << std::endl;
	std::cout << "right = " << B.toString() << std::endl;
}

# data[].attributes.body
#define NOMINMAX

#define USEMATH_DEFINES

#include <cmath>

#include <iostream>

#include "core.h"

int main()

{

cyclone::Vector3 p1(0, 0, 3);

cyclone::Vector3 p2(0, 0, 10);

cyclone::Vector3 p3(5, 0, 5);

cyclone::Vector3 p4(-5, 0, 5);

cyclone::Vector3 v1 = p2 - p1;

cyclone::Vector3 v2 = p3 - p1;

cyclone::Vector3 v3 = p4 - p1;

cyclone::Vector3 d1 = v1.cross(v2);

cyclone::Vector3 d2 = v1.cross(v3);

std::cout << d1.toString() << std::endl;

std::cout << d2.toString() << std::endl;

return 0;

}

# data[].attributes.body
#define USEMATH_DEFINES

#include <iostream>

#include <cmath>

#include "core.h"

using namespace std;

using namespace cyclone;

int main()

{

Vector3 P = Vector3 (0, 0, 3);

Vector3 T = Vector3 (0,0,10);

Vector3 E1 = Vector3 (5,0,5);

Vector3 E2 = Vector3 (-5,0,5);

T = T - P;

E1 = E1 - P;

E2 = E2 - P;

Vector3 C1 = T.cross(E1); //5, 0, 2 와 0, 0, 7의 외적

Vector3 C2 = T.cross(E2); //-5, 0, 2 와 0, 0, 7의 외적

cout << C1.toString() << endl;

cout << C2.toString() << endl;

return 0;

}

# data[].attributes.body
#define _USE_MATH_DEFINES
#include <iostream>
#include "..\Cyclone\core.h"
#include<cmath>
int main()
{
   const double DEGREE_TO_RADIAN = M_PI /180.0f;
   const double RADIANS_TO_DEGREES = 180.0F / M_PI;
   cyclone::Vector3 player(0,0,3);
   cyclone::Vector3 dir_point(0,0,10);
   cyclone::Vector3 dir_player = dir_point - player;

   cyclone::Vector3 enemy1(5,0,5);
   cyclone::Vector3 enemy2(-5,0,5);

   cyclone::Vector3 dir_enemy1 = enemy1 - player;
   cyclone::Vector3 dir_enemy2 = enemy2 - player;


   cyclone::Vector3 cross1 = dir_player.cross(dir_enemy1);
   cyclone::Vector3 cross2 = dir_player.cross(dir_enemy2);


   std::string Direction_cross1 = (cross1.y > 0) ? "right" : "left";

   std::cout<<"cross_enemy1: "<<cross1.toString()<<std::endl;
   std::cout<<Direction_cross1<<std::endl;

   std::string Direction_cross2 = (cross2.y > 0) ? "right" : "left";
   std::cout<<"cross_enemy2: "<<cross2.toString()<<std::endl;
   std::cout<<Direction_cross2<<std::endl;


}

# data[].attributes.body
#define USEMATH_DEFINES

#define NOMINMAX

#include <iostream>

#include "core.h"

#include <cmath>

int main()

{

cyclone::Vector3 p1(0, 0, 10);

cyclone::Vector3 p2(0, 0, 3);

cyclone::Vector3 p3(5, 0, 5);

cyclone::Vector3 p4(-5, 0, 5);

cyclone::Vector3 A = p1 - p2;

cyclone::Vector3 B = p3 - p2;

cyclone::Vector3 C = p4 - p2;

cyclone::Vector3 AB = A.cross(B);

cyclone::Vector3 AC = A.cross(C);

std::cout << AB.toString() << AC.toString() << std::endl;

return 0;

}

# data[].attributes.body
#define NOMINMAX

#define USEMATH_DEFINES

#include <cmath>

#include <core.h>

#include <iostream>

#include "core.h"

using namespace cyclone;

int main()

{

Vector3 a(0, 0, 10);

Vector3 b1(5, 0, 5);

Vector3 b2(-5, 0, 5);

Vector3 c(0, 0, 3);

Vector3 v1 = a - c;

Vector3 v2_1 = b1 - c;

Vector3 v2_2 = b2 - c;

Vector3 c1 = v1.cross(v2_1);

Vector3 c2 = v1.cross(v2_2);

std::cout << c1.toString() << c2.toString() << std::endl;

}

# data[].attributes.body
#define NOMINMAX
#include <iostream>
#include "core.h"
#include <corecrt_math_defines.h>

const double DeGREE_TO_RADIAN = M_PI / 180.0;
const double RADIAN_TO_DEGREE = 180.0 / M_PI;

int main()
{

	//tank게임

	cyclone::Vector3 v1 = cyclone::Vector3(0, 0, 10) - cyclone::Vector3(0, 0, 3); //포가 보는 방향 벡터
	cyclone::Vector3 v2 = cyclone::Vector3(5, 0, 5) - cyclone::Vector3(0, 0, 3); //포가 보는 방향 1
	cyclone::Vector3 v3 = cyclone::Vector3(-5, 0, 5) - cyclone::Vector3(0, 0, 3); //포가 보는 방향 2 (반대)

	float c = v1.dot(v2);
	float d = c / (v1.magnitude() * v2.magnitude());

	double turret_angle = std::acos(d) * RADIAN_TO_DEGREE;

	std::cout << "포의 회전 각도는 : " << turret_angle << "도입니다." << std::endl;
	std::cout << "외적 값: " << v3.cross(v1).toString() << std::endl; //포가 보는 반대 방향 벡터의 외적값
	std::cout << "외적 값: " << v2.cross(v1).toString() << std::endl; //포가 보는 방향 벡터의 외적값
	return 0;
}

# data[].attributes.body
#define NOMINMAX

#define USEMATH_DEFINES

#include <iostream>

#include <cmath>

#include "core.h"

using namespace cyclone;

int main()

{

Vector3 a(0, 1, 0);

Vector3 b(1, 0, 1);

Vector3 c(-3, 3, 2);

Vector3 v = c - b;

a.normalise();

real d = v.dot(a);

std::cout << d << std::endl;

}

# data[].attributes.body
#define NOMINMAX

#define USEMATH_DEFINES

#include <cmath>

#include <iostream>

#include "core.h"

using namespace std;

int main()

{

cyclone::Vector3 n(0, 1, 0);

cyclone::Vector3 p(1, 0, 1);

cyclone::Vector3 x(-3, 3, 2);

cyclone::Vector3 v = x - p;

n.normalise();

cyclone::real d = v.dot(n);

cout << d << endl;

return 0;

}

# data[].attributes.body
#define NOMINMAX

#define USEMATH_DEFINES

#include <iostream>

#include <cmath>

#include "core.h"

using namespace cyclone;

int main()

{

const double DEGREES_TO_RADIAN = M_PI / 180.0f;

const double RADIANS_TO_DEGREES = 180.0f / M_PI;

Vector3 a(0, 0, 3);

Vector3 p1(0, 0, 10);

Vector3 p2(5, 0, 5);

Vector3 a1 = p1 - a;

Vector3 a2 = p2 - a;

float c = a1.dot(a2);

float d = c / (a1.magnitude() * a2.magnitude());

double degree = acos(d) * RADIANS_TO_DEGREES;

std::cout << degree << std::endl;

}

# data[].attributes.body
#define NOMINMAX

#define USEMATH_DEFINES

#include <iostream>

#include <cmath>

#include "core.h"

using namespace cyclone;

int main()

{

const double DEGREES_TO_RADIAN = M_PI / 180.0f;

const double RADIANS_TO_DEGREES = 180.0f / M_PI;

// a = (2,-1,1)

Vector3 a(2, -1, 1);

// b = (1,1,2)

Vector3 b(1, 1, 2);

float d = a.dot(b);

// a와 b사이의 각도

float c = d / (a.magnitude() * b.magnitude());

double degree = acos(c) * RADIANS_TO_DEGREES;

std::cout << degree << std::endl;

}

# data[].attributes.body
#define NOMINMAX

#define USEMATH_DEFINES

#include <cmath>

#include <iostream>

#include "core.h"

using namespace std;

int main()

{

//포의 현재위치는 0,0,3 목표위치는 0,0,10 적위치는 5,0,5

//포의 회전 각도 세타?

cyclone::Vector3 v1(0, 0, 3);

cyclone::Vector3 v2(0, 0, 10);

cyclone::Vector3 v3(5, 0, 5);

//현재벡터

cyclone::Vector3 v4 = v2 - v1;

//목표벡터

cyclone::Vector3 v5 = v3 - v1;

const double DEGREES_TO_RADIAN = M_PI / 180.0f;

const double RADIANS_TO_DEGREES = 180.0f / M_PI;

float d = v4.dot(v5);

float c = d / (v4.magnitude() * v5.magnitude());

double deg = acos(c) * RADIANS_TO_DEGREES;

cout << deg << endl;

return 0;

}

# data[].attributes.body
#define NOMINMAX
#include <iostream>
#include "core.h"

int main()
{

const double DEGREES_TO_RADIAN = M_PI / 180.0f;
const double RADIANS_TO_DEGREES = 180.0f / M_PI;
cyclone::Vector3 v(2, -1, 1);
cyclone::Vector3 u(1, 1, 2);

float dis = v.dot(u);

float c = dis /( u.magnitude() * v.magnitude());
double deg = acos(c) * RADIANS_TO_DEGREES;

std::cout << "각도: " << deg << std::endl;

return 0;
}

# data[].attributes.body
#define USEMATH_DEFINES

#include <iostream>

#include <cmath>

#include "core.h"

using namespace std;

using namespace cyclone;

int main()

{

Vector3 n(0, 1, 0);

Vector3 p(1, 0, 1);

Vector3 x(-3, 3, 2);

Vector3 v = x - p;

n.normalise();

real d = v.dot(n);

cout << d << endl;

return 0;

}

# data[].attributes.body
#define NOMINMAX
#include <iostream>
#include <cmath>
#include "core.h"

// 벡터사이간의 각도 : a*b 내적 / sqrt(a^2) * sqrt(b^2) 길이

int main()
{
  cyclone::Vector3 u(0, 1, 0);
  cyclone::Vector3 p1(1, 0, 1);
  cyclone::Vector3 p2(-3, 3, 2);

  cyclone::Vector3 v1 = p2 - p1;

  //float dot = v1.dot(u); // 벡터의 내적
  float dot = v1.x * u.x + v1.y * u.y + v1.z * u.z;

  std::cout << dot << std::endl;

  return 0;

  cyclone::Matrix4  m;

}

# data[].attributes.body
#define NOMINMAX

#define USEMATH_DEFINES

#include <cmath>

#include <iostream>

#include "core.h"

using namespace std;

int main()

{

cyclone::Vector3 n(0, 1, 0);

cyclone::Vector3 p(1, 0, 1);

cyclone::Vector3 x(-3, 3, 2);

cyclone::Vector3 v = x-p;

n.normalise();

cyclone::real d = v.dot(n);

//cout<< d << "," << c << "," << deg << endl;

cout << d << endl;

# data[].attributes.body
#define NOMINMAX

#include <iostream>

#define USEMATH_DEFINES

#include <cmath>

#include "core.h"

int main()

{

const double RADIANS_TO_DEGREES = 180.0 / M_PI;

cyclone::Vector3 n(0, 1, 0);

cyclone::Vector3 p(1, 0, 1);

cyclone::Vector3 x(-3, 3, 2);

cyclone::Vector3 v = x - p;

n.normalise();

cyclone::real d = v.dot(n);

std::cout << v.dot(n) << std::endl;

}

# data[].attributes.body
#define NOMINMAX
#define _USE_MATH_DEFINES
#include <cmath>
#include <iostream>
#include "core.h"

int main()
{
	const double DEGREES_TO_RADIAN = M_PI / 180.0f;
	const double RADIANS_TO_DGREES = 180.0f / M_PI;
	cyclone::Vector3 n(0, 1, 0);
	cyclone::Vector3 p(1, 0, 1);
	cyclone::Vector3 x(-3, 3, 2);

	cyclone::Vector3 v = x - p;

	n.normalise();
	cyclone::real d = v.dot(n);
	std::cout << d << std::endl;
}

# data[].attributes.body
// assignment 2 by XERONAME

#define USEMATH_DEFINES

#include <iostream>

#include "core.h"

const double DEG_TO_RAD = (M_PI /180.0f);

const double RAD_TO_DEG = (180.0f /M_PI);

// program entry point

int main(void) {

// ==== assignment 2-1 ====

cyclone::Vector3 a, b;

a = cyclone::Vector3(2,-1,1);

b = cyclone::Vector3(1,1,2);

float _dot = a.dot(b);

float c = ( dot /(b.magnitude() *a.magnitude()) );

double result = (acos(_c) *RAD_TO_DEG);

std::cout << "5820658 전형진\n\n패들렛 과제 2-1 계산 결과: " << result;

// ==== assignment 2-2 ====

cyclone::Vector3 p_tank, p_init, p_target, v_init, v_target;

p_tank = cyclone::Vector3(0,0,3); // position of the tank

p_init = cyclone::Vector3(0,0,10); // initial point

p_target = cyclone::Vector3(5,0,5); // position of the enemy

v_init = (p_init -p_tank); // vector of initial-point-looking from tank

v_target = (p_target -p_tank); // vector of enemy-looking from tank

dot = v init.dot(v_target); // perform the dot product

c = ( dot /(v_init.magnitude() *v_target.magnitude()) );

result = (acos(_c) *RAD_TO_DEG);

std::cout << "\n탱크 게임 계산 결과: " << result;

// ==== assignment 2-3 ====

cyclone::Vector3 p_p, p_x, v_n, v_px;

p_p = cyclone::Vector3(1,0,1);

p_x = cyclone::Vector3(-3,3,2);

v_n = cyclone::Vector3(0,1,0);

v_n.normalise();

v_px = (p_x -p_p);

cyclone::real distance = v_px.dot(v_n);

std::cout << "\n프로젝션 벡터 계산 결과: " << distance;

return 0; // program end point

}

# data[].attributes.body
#define NOMINMAX

#define USEMATH_DEFINES

#include <iostream>

#include <cmath>

#include "core.h"

int main()

{

const double DEGREES_TO_RADIAN = M_PI / 180.0f;

const double RADIANS_TO_DEGREES = 180.0f / M_PI;

cyclone::Vector3 n(0, 1, 0);

cyclone::Vector3 p(1, 0, 1);

cyclone::Vector3 x(-3, 3, 2);

n.normalise();

cyclone::Vector3 v = x - p;

cyclone::real d = n.dot(v);

std::cout << d << std::endl;

return 0;

};

# data[].attributes.body
#include <iostream>

#define USEMATH_DEFINES

#include <cmath>

#include "core.h"

int main()

{

cyclone::Vector3 n(0, 1, 0);

cyclone::Vector3 p(1, 0, 1);

cyclone::Vector3 x(-3, 3, 2);

cyclone::Vector3 v = x - p;

n.normalise();

cyclone::real d = v.dot(n);

std::cout << d << std::endl;

return 0;

}

# data[].attributes.body
#define USEMATH_DEFINES

#include <cmath>

#include <iostream>

#include "core.h"

using namespace cyclone;

int main()

{

Vector3 n(0, 1, 0);

Vector3 p(1, 0, 1);

Vector3 x(-3, 3, 2);

Vector3 v = x - p;

n.normalise();

cyclone::real distance = v.dot(n);

std::cout << distance << std::endl;

return 0;

}

# data[].attributes.body
#include <iostream>

#define USEMATH_DEFINES

#include <cmath>

#include "core.h"

using namespace cyclone;

int main()

{

const double DEGREES_TO_RADIAN = M_PI / 180.0f;

const double RADIANS_TO_DEGREES = 180.0f / M_PI;

cyclone::Vector3 a(0,1,0);

cyclone::Vector3 b(1,0,1);

cyclone::Vector3 c(-3,3,2);

Vector3 v = c - b;

a.normalise();

cyclone::real d = v.dot(a);

std::cout << d << std::endl;

}

# data[].attributes.body
#define NOMINMAX
#include <iostream>
#define _USE_MATH_DEFINES
#include <cmath>
#include "core.h"
using namespace cyclone;

int main()
{
	const double DEGRXXS_TO_RADIAN = M_PI / 180.0f;
	const double RADIAN_TO_DEGREES = 180.0f / M_PI;

	Vector3 n(0, 1, 0);
	Vector3 p(1, 0, 1);
	Vector3 x(-3, 3, 2);

	Vector3 v = x - p;

	n.normalise();
	real d = v.dot(n);

	std::cout << d << std::endl;

}

# data[].attributes.body
#include <iostream>

#define USEMATH_DEFINES

#include <cmath>

#include "core.h"

int main()

{

cyclone::Vector3 n(0, 1, 0);

cyclone::Vector3 p(1, 0, 1);

cyclone::Vector3 x(-3, 3, 2);

cyclone::Vector3 v = x - p;

n.normalise();

cyclone::real d = v.dot(n);

std::cout << d << std::endl;

return 0;

}

# data[].attributes.body
#define NOMINMAX

#define USEMATH_DEFINES

#include <iostream>

#include <cmath>

#include "core.h"

int main()

{

const double DEGREES_TO_RADIAN = M_PI / 180.0f;

const double RADIANS_TO_DEGREES = 180.0f / M_PI;

cyclone::Vector3 a(0, 1, 0);

cyclone::Vector3 b(1, 0, 1);

cyclone::Vector3 c(-3, 3, 2);

cyclone::Vector3 v = c - b;

a.normalise();

cyclone::real d = v.dot(a);

std::cout << d << std::endl;

return 0;

}

# data[].attributes.body
#include <iostream>
#define _USE_MATH_DEFINES
#include <cmath>
#include "core.h"

using namespace cyclone;
using namespace std;

int main()
{
	cyclone::Vector3 n(0, 1, 0);
	cyclone::Vector3 p(1, 0, 1);
	cyclone::Vector3 x(-3, 3, 2);
	cyclone::Vector3 v = x - p;
	n.normalise();
	cyclone::real d = v.dot(n);
	cout << d << endl;
}

# data[].attributes.body
#include <iostream>
#define _USE_MATH_DEFINES
#include <cmath>
#include "core.h"
using namespace cyclone;
int main()
{
	Vector3 n(0, 1, 0);
	Vector3 p(1, 0, 1);
	Vector3 x(-3, 3, 2);
	Vector3 v = x - p;
	//n.normalise(); 이미 유닛 벡터이므로 생략
	cyclone::real d = v.dot(n);
	std::cout << d << std::endl;
}

# data[].attributes.body
#include <iostream>

#define USEMATH_DEFINES

#include <cmath>

#include "core.h"

using namespace cyclone;

int main()

{

//문제3

Vector3 n(0, 1, 0);

Vector3 p(1, 0, 1);

Vector3 x(-3, 3, 2);

Vector3 v = x - p;

n.normalise();

real d = v.dot(n);

std::cout << d << std::endl;

}

# data[].attributes.body
#define NOMINMAX

#define USEMATH_DEFINES

#include <iostream>

#include "core.h"

int main()

{

cyclone::Vector3 n(0, 1, 0);

cyclone::Vector3 p(1, 0, 1);

cyclone::Vector3 x(-3, 3, 2);

cyclone::Vector3 v = x - p;

n.normalise();

cyclone::real d = v.dot(n);

std::cout << d << std::endl;

return 0;

}

# data[].attributes.body
#include <iostream>

#define NOMINMAX

#define USEMATH_DEFINES

#include <cmath>

#include "core.h"

using namespace cyclone;

using namespace std;

int main()

{

Vector3 n(0, 1, 0);

Vector3 p(1, 0, 1);

Vector3 x(-3, 3, 2);

Vector3 v = x - p;

n.normalise();

real d = v.dot(n);

cout << d << endl;

}

# data[].attributes.body
#define NOMINMAX

#define USEMATH_DEFINES

#include <cmath>

#include <core.h>

#include <iostream>

#include "core.h"

using namespace cyclone;

int main()

{

Vector3 n(0, 1, 0);

Vector3 p(1, 0, 1);

Vector3 x(-3, 3, 2);

Vector3 v = x - p;

n.normalise();

real d = v.dot(n);

std::cout << d << std::endl;

}

# data[].attributes.body
#include <iostream>
#include <cmath>

#include "core.h"

int main()
{
	cyclone::Vector3 n(0, 1, 0);
	cyclone::Vector3 p(1, 0, 1);
	cyclone::Vector3 x(-3, 3, 2);

	cyclone::Vector3 v = x - p;
	n.normalise();
	cyclone::real dot_nv = n.dot(v);
	std::cout << dot_nv << std::endl;

	return 0;
}

# data[].attributes.body
#define NOMINMAX
#include <iostream>
#define _USE_MATH_DEFINES
#include <cmath>
#include "core.h"

int main()
{
	cyclone::Vector3 n(0, 1, 0);
	cyclone::Vector3 p(1, 0, 1);
	cyclone::Vector3 x(-3, 3, 2);
	cyclone::Vector3 v = x - p;
	std::cout << v.dot(n) << std::endl;
}

# data[].attributes.body
#include <iostream>

#define NOMINMAX

#define USEMATH_DEFINES

#include <cmath>

#include "core.h"

using namespace cyclone;

int main()

{

const double DEGREES_TO_RADIAN = M_PI / 180.0f;

const double RADIANS_TO_DEGREES = 180.0f / M_PI;

Vector3 n(0, 1, 0);

Vector3 p(1, 0, 1);

Vector3 x(-3, 3, 2);

// x-p 벡터

Vector3 v = x - p;

// 프로젝션 벡터

n.normalise();

// 내적

real distance = v.dot(n);

std::cout << "minimum distance : " << distance << std::endl;

}

# data[].attributes.body
#define NOMINAX

#include <iostream>

#define USEMATH_DEFINES

#include <cmath>

#include "core.h"

using namespace cyclone;

int main()

{

Vector3 n(0, 1, 0);

Vector3 p(1, 0, 1);

Vector3 x(-3, 3, 2);

Vector3 v = x - p;

n.normalise();

cyclone::real d = v.dot(n);

std::cout << d << std::endl;

}

# data[].attributes.body
#define NOMINMAX

#include <iostream>

#define USEMATH_DEFINES

#include <cmath>

#include "core.h"

int main()

{

cyclone::Vector3 n(0, 1, 0);

cyclone::Vector3 p(1, 0, 1);

cyclone::Vector3 x(-3, 3, 2);

cyclone::Vector3 v = x - p;

n.normalise();

cyclone::real d = v.dot(n);

std::cout << d << std::endl;

}

# data[].attributes.body
#define USEMATH_DEFINES

#define NOMINMAX

#include <iostream>

#include "core.h"

#include <cmath>

int main()

{

cyclone::Vector3 n(0, 1, 0);

cyclone::Vector3 p(1, 0, 1);

cyclone::Vector3 x(-3, 3, 2);

cyclone::Vector3 v = x - p;

n.normalise();

cyclone::real d = v.dot(n);

std::cout << d << std::endl;

return 0;

}

# data[].attributes.body
#define NOMINMAX

#define USEMATH_DEFINES

#include <iostream>

#include<cmath>

#include "core.h"

int main()

{

cyclone::Vector3 n(0, 1, 0);

cyclone::Vector3 p(1, 0, 1);

cyclone::Vector3 x(-3, 3, 2);

n.normalise();

cyclone::Vector3 v = x-p;

cyclone::real d = n.dot(v);

std::cout << d;

return 0;

}

# data[].attributes.body
#include <iostream>
#define _USE_MATH_DEFINES
#include <cmath>
#include "core.h"
int main() {
	cyclone::Vector3 n(0, 1, 0);
	cyclone::Vector3 p(1, 0, 1);
	cyclone::Vector3 x(-3, 3, 2);

	cyclone::Vector3 v = x - p;
	n.normalise();

	cyclone::real distance = v.dot(n); //벡터v를 단위 벡터n에 투영한 길이가 점과 평면 사이의 거리이다.

	std::cout << "점과 평면 사이의 거리는 : " << distance << std::endl;

	return 0;
}

# data[].attributes.body
#define _USE_MATH_DEFINES
#include <iostream>
#include "..\Cyclone\core.h"
#include<cmath>
int main()
{
   const double DEGREE_TO_RADIAN = M_PI /180.0f;
   const double RADIANS_TO_DEGREES = 180.0F / M_PI;
   cyclone::Vector3 n(0,1,0);
   cyclone::Vector3 p(1,0,1);
   cyclone::Vector3 x(-3,3,2);
   cyclone::Vector3 Dir = x-p;
   double D = Dir.dot(n);
   std::cout<<D<<std::endl;

}

# data[].attributes.body
#include <iostream>

#define USEMATH_DEFINES

#include <cmath>

#include "core.h"

using namespace cyclone;

int main()

{

const double DEGREES_TO_RADIAN = M_PI / 180.0f;

const double RADIANS_TO_DEGREES = 180.0f / M_PI;

cyclone::Vector3 a(0,0,3);

cyclone::Vector3 b(0,0,10);

cyclone::Vector3 c(5, 0, 5);

cyclone::Vector3 ba = b - a;

cyclone::Vector3 ca = c - a;

float d = ba.dot(ca);

float e = d / (ba.magnitude() * ca.magnitude());

double deg = acos(e) * RADIANS_TO_DEGREES;

std::cout << deg << std::endl;

}

# data[].attributes.body
#define NOMINMAX
#include <iostream>
#include <cmath>
#include "core.h"

int main()
{
    const double RADIANS_TO_DEGREES = 180.0 / M_PI;

    cyclone::Vector3 a(0, 0, 10);
    cyclone::Vector3 b(0, 0, 3);
    cyclone::Vector3 c(5, 0, 5);

    cyclone::Vector3 v1 = a - b;
    cyclone::Vector3 v2 = c - b;

    float dis = v1.dot(v2);
    float cosTheta = dis / (v1.magnitude() * v2.magnitude());
    double deg = acos(cosTheta) * RADIANS_TO_DEGREES;

    std::cout << "각도: " << deg << std::endl;

    return 0;
}