A rectangle is a geometric shape: any quadrilateral with four right angles
Questions tagged [rectangles]
1373 questions
-1
votes
2 answers
Half Rounded rectangle in C# Path
I've got question,
I have rounded rectangle. It's only rounded on right side, and straight on left. I want to make that in other way - left rounded, right straight.
What should I change?
int ArcWidth = 10 * 2;
int ArcHeight = 10 * 2;
int ArcX1 =…

boski
- 1,106
- 3
- 21
- 44
-1
votes
1 answer
Calculating area of intersection of rectangles in java
I have a problem with one algorithm. I suppose to calculate the area of intersection of 2 rectangles(both are paraller to the OX and OY).
The rectangle(let's call it A) is described by (x1,y1,x2,y2) upper left corner(x1,y1) and lower right corner…

Yoda
- 17,363
- 67
- 204
- 344
-1
votes
4 answers
I am trying to understand the different syntax of creating rectangles
I understand this code here. The point of origin is 0,0 or top left of the JFrame and the width of the rectangle is 9 and height covers from bottom to top.
Rectangle left = new Rectangle(0,0,WIDTH/9,HEIGHT);
But I don't quite understand this. What…

Martin Marino
- 375
- 2
- 5
- 14
-1
votes
1 answer
What are the int and multiplication signs doing here?
Can anyone explain what the purpose of the ints are in Rectangle center and Rectangle obstacle? I already understand that an int is a positive or negative whole number. Also why don't I need any ints in Rectangle left and Rectangle right if they are…

Martin Marino
- 375
- 2
- 5
- 14
-2
votes
1 answer
Draw large numbers of rectangles on map (Gmaps API/leaflet.js)
I am trying to draw colored cells on a JS map API, at very large scale ~(70k rectangles).
NOTE: There is no reasonably short amount of example code i can show you for this isnt a "coding issue" so much as it is a request for direction in library…

John Thummel
- 23
- 6
-2
votes
1 answer
Java: Drawing two rectangles breaks
I filled two rectangles in this way:
graphics.setColor(Color.RED);
graphics.translate(0, 150);
graphics.fillRect(0,0,65,65); // First rect
graphics.dispose(); // If remove this line, nothing will change
graphics.translate(0,…

Jenka 20091
- 1
- 3
-2
votes
1 answer
A selection-rectangle (drawn by mouse on canvas) does not recognize rectangles, which are inside that selection-rectangle (C# WPF)
I am now really desperate. I just can't get any further and in principle it shouldn't be that difficult. I tried solving it the last 2 weeks.
The following task/problem:
I have a canvas in my C# WPF project called “MarkPointsMap”, on which there are…

s950mpc2000
- 45
- 6
-2
votes
1 answer
Defining 4 co-ordinates from 2 in a rectangular shape (python)
so I currently have 2 points in the format [(x0, x1, y0, y1)] which I know are a rectangular shape but I am looking to have this list updated so that it is all 4 points of the rectangle. Note: the rectangle can only be drawn vertically or…

Jack Timber
- 45
- 1
- 1
- 5
-2
votes
1 answer
Why won't Pythagorean theorem work for me?
How do i check if the follow is a right angled triangle?
I have:
A = 5
B = 1
C = ?
How do i know if this IS or ISNT a right angle?
please help!

OfficialCee
- 7
- 2
-2
votes
1 answer
How to draw a rounded rectangle with width less than height? C#
I have been looking for quite a while for an already pre-made function for creating a rounded rectangle that doesn't cause tearing/glitching like the one below. Credits to @György Kőszeg. This function works fine if the rectangle is big enough. When…

ViperzSmurfz
- 7
- 6
-2
votes
1 answer
How to get each value of x,y,w,h in this crop image?
i want to ask something. In opencv there is cv2.rectangle to build a rectangle of object interest. After I got the object interest which is represent with rectangle, I want to get the region of interest box. To do that I used crop = frame[y:y+h,…

Ines
- 11
- 5
-2
votes
2 answers
Rectangle/Rectangle Collision Detection
I am trying to solve an issue when two rectangles intersect/overlap each other. when this happens, i want to know if intersection is True or False. I found a solution, however it is written in C or C++. I want to write these code in Python.
Here is…

skylon
- 19
- 5
-2
votes
1 answer
What algorithm is used in this animation from Yojouhan Shinwa Taikei?
Is there a name for the type of effect where rectangular shapes are increased/decreased in size relational to each other? I'm looking for a general algorithm, formula, diagram, etc so I can re-create it in d3.js. Here it is (originally made in After…

Sosa
- 814
- 1
- 9
- 20
-2
votes
2 answers
Find whether two rectangles overlap
I am trying to find whether two rectangles overlap each other or not. I have the following rectangles represented as [x1,x2] x [y1,y2]
Rect 1 = [0.0, 1.0] x [0.0, 1.0]
Rect 2 = [0.7, 1.2] x [0.9, 1.5]
I just need a pseudo code that I can implement…

shahmeer arhsad
- 49
- 1
- 2
- 8
-2
votes
1 answer
Not setting variable to rectangle in canvas
I am trying to get the rectangle to move when you click a button by adding 1 to the x/y pos of the rectangle but the speed variable keeps saying undefined.
// . . . //
function component(width, height, color, x, y) {
this.width =…

Tjtorin
- 99
- 1
- 1
- 10