Forums: » Register « |  Free Tools |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |

New Free Tools on Dev Shed!

#1
January 18th, 2013, 05:46 AM
 Cellendhyll
Registered User

Join Date: Jan 2013
Posts: 2
Time spent in forums: 17 m 43 sec
Reputation Power: 0
Help for my project please :)

Hi everyone,

I'm an erasmus student in an engineering school in Warsaw and I have a small problem with a project I have to realise. Here is the subject :

"Generate by random a set of n points in 2D Cartesian Coordinates System. Find a quadrilateral enveloping all the points wich area is the greatest. Use functions for reading, printing appropriate data. Use local variables."

The problem is not for the language part. I just don't understand how to do it.
I'm not sure I'm really clear but the help I need is about the different steps leading to the solution.

From what my teacher told me, I understood :
"Generate the points
Create lines which goes through at least one point and have the following propriety : all the points are on one side of the line.
Compare area of the quadrilateral and take the greatest."

Is it correct? From my point of view, it's not really clear :/

#2
January 18th, 2013, 05:47 AM
 Cellendhyll
Registered User

Join Date: Jan 2013
Posts: 2
Time spent in forums: 17 m 43 sec
Reputation Power: 0
I forgot to say thank you

#3
January 18th, 2013, 06:15 AM
 salem
Contributed User

Join Date: Jun 2005
Posts: 4,251
Time spent in forums: 2 Months 4 Weeks 1 Day 12 h 3 m 13 sec
Reputation Power: 1809
How interesting....

It seems like someone else has the same question

> Is it correct? From my point of view, it's not really clear :/
I don't know - it sounds good though.
I suggest pencil and paper, draw 3 points on the paper and work through your "algorithm" to see if it produces the right answer.

You won't be able to write the code until you understand the math/geometry which lies behind it.

> I forgot to say thank you
You also forgot to post any code.
__________________
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper

 Viewing: Dev Shed Forums > Programming Languages > C Programming > Help for my project please :)