hi all,
i have to make a rectangle in c++.
The inputs are length,breadth,center point and the aspect angle.
The rectangle should be tilted at that angle

Recommended Answers

All 3 Replies

Hi;
There is built in funtion in c++ for drawing a rectangle
U should include graphics.h as the header file
and call the function rectangle(int,int,int,int);

It takes four parameter as x1,y1,x2,y2 as the coordinates

For the angle U can calculate from the angle that what coordinates u have to give,,,,,,,,.

I hope that the problem is clear but if still there are some problems ask again......


Fahad

Take the points (1,1), (1,-1), (-1,1) and (-1,-1). Stretch the set to however wide/tall you need, then run all four through

x *= cos(a);
y *= sin(a);

It's the same principle as in the rotated-ellipse problem.

Hi there,

Per the terms of our forum, have you written any code yourself? We're not here to write code or do your homework for you-- you need to show effort of your own for us to help you more effectively.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.