[CPP] 1차 방정식을 통한 y값 구하기

simpled 2013.06.23 15:04 조회 수 : 5777

그냥...

 

#include "iostream"

using namespace std;

int main(void)
{
 double L1, L2;
 double M1, M2;
 double dx, dy;
 double a, b; 
 double x, y;

 L1 = -1180;
 L2 = -1150;

 M1 = 0.97;
 M2 = 0.98;

 dx = L2 - L1;
 dy = M2 - M1;

 cout <<"dx : " << dx <<endl;
 cout <<"dy : " << dy <<endl;

 


 a = dy / dx;
 cout <<"a : " << a <<endl;
 b = M1 - (L1 * a);
 cout <<"b1 : " << b <<endl;
 b = M2 - (L2 * a);
 cout <<"b2 : " << b <<endl;

 x = -1175;
 y = a*x+b;
 
 cout <<"x : " << x <<endl;
 cout <<"y : " << y <<endl;
 
 return 0;
}

번호 제목 글쓴이 날짜 조회 수
29 [CPP] file 입출력 : space data file simpled 2013.06.23 5257
» [CPP] 1차 방정식을 통한 y값 구하기 simpled 2013.06.23 5777
27 [CPP] Vector 계산 클래스 (v2.0) file simpled 2013.06.23 4675
26 [CPP] 자리수 표현 simpled 2013.06.23 5618
25 [CPP] 각도 클래스(+ 아크탄젠트 리턴값 조정) file simpled 2013.06.23 6024
24 [CPP] 벡터 계산 클래스 file simpled 2013.06.23 6090
23 [CPP] file 입출력 simpled 2013.06.23 4964
22 [CPP] 수치해석 : Rectangle Method 구분구적분 (적분 프로그래밍) simpled 2013.06.23 8111
21 [CPP] 분포하중 _ Beam의 SFD, BMD 값 simpled 2013.06.23 6471
20 [CPP] OOP6. CPP Programming :: Virtual Banking system PPT [끝] file 심플디 2013.06.23 6607
19 [CPP] OOP6. CPP Programming :: Virtual Banking system v3.8 file simpled 2013.06.23 5920
18 [CPP] OOP6. CPP Programming :: Virtual Banking system 모듈프로그램들 file simpled 2013.06.23 5244
17 [CPP] OOP6. CPP Programming :: Virtual Banking system v3.7 file simpled 2013.06.23 5954
16 [CPP] OOP6. CPP Programming :: Virtual Banking system v3.6 file simpled 2013.06.23 6287
15 [CPP] OOP6. CPP Programming :: Virtual Banking system v3.5.1 file simpled 2013.06.23 6442
14 [CPP] OOP6. CPP Programming :: Virtual Banking system v3.5 file simpled 2013.06.23 6620
13 [CPP] -----------------------------------절취선----------------------------------- simpled 2013.06.23 5830
12 [CPP] Banksys 휴식 simpled 2013.06.23 6496
11 [CPP] OOP5. CPP Programming :: Virtual Banking system v3.0.2 [Class design3. String Sorting] simpled 2013.06.23 5612
10 [CPP] OOP5. CPP Programming :: Virtual Banking system v3.0.2 [Class design2. File I/O] simpled 2013.06.23 6548