Questions tagged [rectangles]

A rectangle is a geometric shape: any quadrilateral with four right angles

1373 questions
-1
votes
1 answer

Hollow Rectangle with Asterisks

I know there are numerous way to do this but I am trying to print a rectangle using ranges and if else statements. My code is below works but only cause I have hard coded the spaces required in print statement at line 7. As soon as the values for…
negru08
  • 5
  • 1
  • 4
-1
votes
1 answer

Rectangle only paints sections which a label has passed over on c# form

I have a question about a program I am writing for practice, which in its current state allows the user to move a label around the Form using the arrow keys. I want to start adding some graphical rectangles to my program, and am currently practicing…
Christian T
  • 128
  • 1
  • 12
-1
votes
1 answer

How to create rhombus described on rectangle

Let's say I have a rectangle of width w and height h centered at coordinate origin. How I can create rhombus described on this rectangle? Additional requirement is that rhombus width should be twice as height. Any ideas?
user3848246
  • 127
  • 1
  • 5
-1
votes
2 answers

How do I make a rectangle using arrays so that I can have multiple showing on the screen at once?

The title is pretty self explanatory. I'm trying to find out how to make a rectangle with arrays for this tetris game in python. Here's the code: screen = pygame.display.set_mode((400,800)) #Rectangle Variables x = 200 y = 0 width = 50 height =…
-1
votes
1 answer

Adding clickable boxes inside picturebox c#

So I have a picture box that I need to draw rectangles or declare regions either or, so that the user can click on an area of the picture and it do something. I have searched and searched about this and have come to the conclusion that I do either…
Morrg
  • 5
  • 6
-1
votes
1 answer

Draw a series of rectangles with ggplot2, using different colors

I guess this questions has been asked already but I will try it anyways, as I couldn't find anything thich solved my problem. I simply want to draw a series of rectangles, and then color them depending on a value, but not the x or y value. So: I…
malajedala
  • 867
  • 2
  • 8
  • 22
-1
votes
1 answer

WPF MVVM: Top panel to block all controls

My main window view:
Willy
  • 9,848
  • 22
  • 141
  • 284
-1
votes
1 answer

Detect whether four points or four lines in 2D space can map to a flat right-angled rectangle rotated in 3D space

We are given either: 4 points in Cartesian coordinates 4 straight lines in Cartesian space We assume this 2D Cartesian space is a perspective projection of a 2D space. I may be wrong but I believe right-angled rectangles impose a constraint such…
hippietrail
  • 15,848
  • 18
  • 99
  • 158
-1
votes
1 answer

Using Bresenham's line-algorithm or similar to fill a rectangle

I would like to create a filled rectangle from four points using Bresenham's line-algorithm or similar to get smooth sides. I came across this answer on Stack Overflow [link] that works perfectly for creating a line between two points. How can I…
Blc
  • 58
  • 5
-1
votes
3 answers

WPF XAML: Fill Rectangle with color blue and within an image and text in center X,Y

I have rectangle below which mission is to overlay above all other controls in the grid:
Willy
  • 9,848
  • 22
  • 141
  • 284
-1
votes
1 answer

How to identify other corners of rectangle?

I am working in MATLAB on attached image. The rough rectangle may be having breaks (noise) at some points along its perimeter. The location of two corner points of rectangle (shown blue and red) is given. How can i identify other two corners of this…
erbal
  • 421
  • 5
  • 18
-1
votes
1 answer

how to find coordinates of rectangle, if one cordinate is known of rectangle

I have one rectangle with four corners say (x1,y1), (x2,y2), (x3,y3),(x4,y4). where (x1,y1) is bottom left corner, (x2,y2) is bottom right , (x3,y3)upper left and (x4,y4) upper right. I only have values of (x1,y1)that is (95.946236, 5.907290) and…
NIrbhay Mathur
  • 153
  • 1
  • 1
  • 10
-1
votes
1 answer

Rectangle packing in Java

I'm trying to implement a rectangle packing algorithm. I have some rectanges on my input Each rectangle have a heigth and a width(and an index number, so i will be able to identify them when i log them) I have a matrix (an Integer[][]), and i want…
-1
votes
1 answer

Rectangle contains Point returns false

I am making a simple Pacman game using c# in Visual studio. I decided to make a rectangles of a maze in which the main character can walk. I have a rectangle which covers main character's bounds: Rectangle _pacmanBound = new Rectangle(Left, Top, 28,…
EtherPaul
  • 424
  • 10
  • 19
-1
votes
1 answer

Return true if the point lies within the boundaries of the rectangle

I'm needing to find the point lies within the boundaries of the rectangle or its border. The code I have so far is not finding if the point lies within the boundaries of the rectangle or its border. Please help. Here is what I have so far and this…
rls1982
  • 85
  • 3
  • 13