Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- double tArea(double ax,double ay,double bx,double by,double cx,double cy)
- {
- double t=abs( (ax-cx)*(by-ay)-(ax-bx)*(cy-ay) )/2;
- return t;
- }
- int main()
- {
- cout << tArea(20,10,20,50,50,10) << endl; // 600
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment