# How to separate the point2f to other variable?

Hello, I had obtained the centroid coordinate in terms of float and array, Point2f a = mc[0]; Point2f b = mc[1];

the next step for me is to get the angle between these two points. By looking at the example throughout the net, the point2f must be separated to x1,y1 and x2,y2 so I can calculate the atan for the angle.

THe problem here I could not manage to get the values inside mc[0] and mc[1] for x1,y1 and x2,y2.

what I had tried and failed is using this statement

float x1,x2,y1,y2; [x1,y1] = mc[0];

Anyone would help on this? Or is there any faster way to find the atan - angle for the two centroids coordinate I have obtained?

edit retag close merge delete

@thdrksdfthmn sorry to make you surprise for the question :) . I'm quite a beginner person on this. Anyway, the solution above is correct. TQSM!! :)

( 2015-10-01 02:14:16 -0500 )edit
1

No problem, so good luck learning!

( 2015-10-01 05:12:02 -0500 )edit

Sort by ยป oldest newest most voted

Point2f has 2 members: x and y, so you can just call them: a.x and a.y

more

Official site

GitHub

Wiki

Documentation