Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
我用的是向量差积算面积In Reply To:用ABsinC/2求面积 ----> Posted by:Bluebird at 2005-07-21 21:02:19 > double getarea(int a, int b, int c) > { int t1, t2, t3; > double s1, s2, s3; > t1 = (c + n - a) % n; > s1 = d * sin(t1 * alph) / 2; > t2 = (b + n - a) % n; > s2 = d * sin(t2 * alph) / 2; > t3 = (c + n - b) % n; > s3 = d * sin(t3 * alph) / 2; > return s2 + s3 - s1; > } > > > 调用的时候修改为 > > getarea(0, cc[p], cc[i]); > getarea(0, cc[p - 1], cc[i]); > getarea(cc[i], cc[q], 0); > getarea(cc[i], cc[q - 1], 0); Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator