-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Atomic level feature draft #2784
base: master
Are you sure you want to change the base?
Conversation
else { | ||
float tan = dy / dx; | ||
float at = atan(tan); | ||
angle = (dx < 0) ? PI / 2 + at : -PI / 2 + at; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be good idea to specify that function finds angle between point and Y axis. also, I believe atan2 is prefered
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@drizhina Yes, thanks. Possibly will refine all rotation to rays not setions as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you could use float Vec2f::tiltAngle()
return str; | ||
|
||
size_t detectionDomain = str.size() - substr.size() + 1; | ||
detectionDomain = (substr == "\\t" || substr == "\\r" || substr == "\n") ? detectionDomain + 1 : detectionDomain; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure about \\n
and \\r
, but \n
(only one \
)?
std::string res; | ||
for (size_t i = 0; i < str.size(); ++i) { | ||
if (stop) { | ||
res += str[i]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we do str.replace(...) to avoid multiple allocations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will refine to classical str replace as additional feature of replace first is not required any more
A couple of items before proceeding. @AliaksandrDziarkach, @vanoprenko FYI
|
Remove-me-sectionAtomic level feature draft