Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7020289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:17:58+00:00 2026-05-27T23:17:58+00:00

vector<CGPoint>::iterator i; vector<CGPoint>* bp = bicyclePad.bikePathPoints; for(i = bp->begin(); i != bp->end()-3; i++){ angle

  • 0
vector<CGPoint>::iterator i;
vector<CGPoint>* bp = bicyclePad.bikePathPoints;
for(i = bp->begin(); i != bp->end()-3; i++){
    angle = atan2((*i).y/(*i).x) * 180/ PI;
}

I guess atan2 can only be used with floats and doubles. but I am trying to do it with an iterator. How would I go about doing the above?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T23:17:59+00:00Added an answer on May 27, 2026 at 11:17 pm

    atan2 takes two arguments:

    angle = std::atan2(i->y, i->x) * 180 / PI;
    

    should work fine. The correct overload (depending on what CGFloat typedefs to) will be chosen.

    Note that i->x and i->y (which are strictly equivalent to (*i).x and (*i).y) are numbers (of type CGFloat), not iterators.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

std::vector< std::vector<coords> >::iterator iter; for(iter = characters.begin(); iter != characters.end(); iter++) { std::vector<coords>* cha
vector<Widget> vw; // populate vw sort(vw.begin(), vw.end()); Widget w; vector<Widget>::iterator i = lower_bound(vw.begin(), vw.end(),
std::vector<int> va; // and push_back 1~100 std::vector<int>::iterator i = va.begin(); for(i; i != va.end();
std::vector<std::wstring> lines; typedef std::vector<std::wstring>::iterator iterator_t; iterator_t eventLine = std::find_if(lines.begin(), lines.end(), !is_str_empty()); how do I
vector< vector<int> >::iterator temp = mincost.end(); vector<int> a = *temp; if ( *temp !=
vector<int> nums; nums.push_back(0); nums.push_back(1); nums.push_back(2); nums.push_back(3); vector<int>::iterator it = nums.begin(); it++; cout << it
std::vector<int> my_ints; my_ints.push_back(1); my_ints.push_back(2); my_ints.push_back(3); my_ints.push_back(4); std::for_each(my_ints.begin(), my_ints.end(), std::cout.operator <<);
for (vector<Student_info>::const_iterator iter = students.begin(); iter != students.end(); ++iter) cout << (*iter).name << endl;
std::vector<std::string>::iterator it; it = NULL; do { if(it == NULL) it = init.begin(); else
std::vector<Enemy*>::iterator it; for(it;it!=tracked.end();it++){ (*it)->update(timeSinceLastFrame); } tracked is the vector: std::vector<Enemy*> Why am I getting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.