0_0_13781293_30580.cpp: In function 'double calculateArea(polygon&)':
0_0_13781293_30580.cpp:24:24: error: invalid initialization of non-const reference of type 'vector& {aka std::complex<double>&}' from an rvalue of type 'std::complex<double>'
a += crossProduct(*p - poly[0], *(p + 1) - poly[0]);
^
0_0_13781293_30580.cpp:16:8: note: in passing argument 1 of 'double crossProduct(vector&, vector&)'
double crossProduct(::vector &a, ::vector &b)
^
0_0_13781293_30580.cpp: In function 'vertex lineIntersection(line&, line&)':
0_0_13781293_30580.cpp:33:31: error: invalid initialization of non-const reference of type 'vector& {aka std::complex<double>&}' from an rvalue of type 'std::complex<double>'
double c = crossProduct(a.pb - a.pa, b.pb - b.pa);
^
0_0_13781293_30580.cpp:16:8: note: in passing argument 1 of 'double crossProduct(vector&, vector&)'
double crossProduct(::vector &a, ::vector &b)
^
0_0_13781293_30580.cpp:36:48: error: invalid initialization of non-const reference of type 'vector& {aka std::complex<double>&}' from an rvalue of type 'std::complex<double>'
return a.pa + (a.pb-a.pa) * (crossProduct(b.pb- b.pa, a.pa - b.pa) / c);
^
0_0_13781293_30580.cpp:16:8: note: in passing argument 1 of 'double crossProduct(vector&, vector&)'
double crossProduct(::vector &a, ::vector &b)
^
0_0_13781293_30580.cpp: In function 'int side_count(line&, int, int)':
0_0_13781293_30580.cpp:53:26: error: invalid initialization of non-const reference of type 'vector& {aka std::complex<double>&}' from an rvalue of type 'std::complex<double>'
if (crossProduct(l.pb - l.pa, verties[i] - l.pa) > 0)
^
0_0_13781293_30580.cpp:16:8: note: in passing argument 1 of 'double crossProduct(vector&, vector&)'
double crossProduct(::vector &a, ::vector &b)
^
0_0_13781293_30580.cpp: In function 'int main()':
0_0_13781293_30580.cpp:88:66: error: invalid initialization of non-const reference of type 'polygon& {aka std::vector<std::complex<double> >&}' from an rvalue of type 'polygon {aka std::vector<std::complex<double> >}'
printf("Case #%d: %f\n", cc, calculateArea(createPolygon(lines)));
^
0_0_13781293_30580.cpp:20:8: note: in passing argument 1 of 'double calculateArea(polygon&)'
double calculateArea(polygon &poly)
^
|