Click here to Skip to main content
15,897,187 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Develop a new prototype cockroach robot.Given the size, position and orientation angle of the robot and obstacle wall define by a line. Estimate the collusion position and distance travelled by simulating the movements of the robot over different time steps

What I have tried:

#include <iostream>
#include <cstdlib>
#include <vector>
#include <cmath>
#include <string>
#include <omp.h> // Compiler/Linker Options are already set in C::B '.CBP' file

using namespace std;

//Structures and functions
struct point_type
{
	double x, y;
	point_type();
	point_type(double x, double y);
};

struct circle_type
{
	point_type position;
	double radius;
	circle_type();
	circle_type(point_type position,double radius);
};

point_type::point_type()
{
	x = 0.0;
	y = 0.0;
}
point_type::point_type(double x,double y)
{
	this->x=x;
	this->y=y;
}

circle_type::circle_type()
{
	position=point_type();
	radius=0.0;
}

circle_type::circle_type(point_type position, double radius)
{
	this->position=position;
	this->radius=radius;
}
Posted
Comments
OriginalGriff 1-Mar-21 6:18am    
And?
What does it do that you didn't expect, or not do that you did?
What have you tried to do to find out why?
Are there any error messages, and if so, where and when? What did you do to make them happen?

This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with.
Use the "Improve question" widget to edit your question and provide better information.
Rick York 1-Mar-21 11:35am    
OK, you have a point structure and a circle structure. You also have a problem statement. What you do not have is a question. This is really just a trigonometry problem with a little bit of algebra thrown in to calculate positions. You will have to assume the velocity of the robot since it isn't stated.

So, what's your question?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900