Questions tagged [rectangles]

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

1373 questions
-1
votes
1 answer

Placing Rectangle with earliest startdate on first spot (Gantt Chart)

In my program i have 4 "workPackages" with different start and enddates, this looks like this: WorkPackage[] workpackages = new WorkPackage[4]; workpackages[0] = new WorkPackage("Package 1", new DateTime(2021, 1, 7), new DateTime(2021, 2,…
Connor
  • 3
  • 16
-1
votes
1 answer

Draw rectangle using coordinates of length edge and width on Html Canvas

I am leaning to work with canvas objects. I have the following coordinates: A: [x1,y1] B: [x2,y2] and a width which is a number. I want to draw a rectangle on the canvas using these information. I know that the output can be two rectangles both…
Majid Hojati
  • 1,740
  • 4
  • 29
  • 61
-1
votes
1 answer

How to find right coordinates from numpy array

I have a numpy array with 4 coordinates of rect/quadrilateral: pts = np.array([(690, 110), (345, 130), (690, 300), (445, 298)]) Note that these are not in order. Now I want to find the top_left, top right, bottom left, bottom right of a…
Ahmad Anis
  • 2,322
  • 4
  • 25
  • 54
-1
votes
1 answer

Bounding Box using eight points MATLAB

I have eight points(four pairs) (x1,y1), (x2,y2), (x3,y3), (x4,y4). How can I make the transparent bounding box on the image using these points?
Aadnan Farooq A
  • 626
  • 4
  • 8
  • 19
-1
votes
1 answer

Rectangle from numbers, internal numbers are high and external numbers are low, there is a problem with some numbers

I have an exercise I need to submit. The user should enter 2 numbers, one of height and one of width, and the output should be a rectangle that the outer numbers are low and the inner ones are high. So I wrote it but it does not work in some…
-1
votes
2 answers

WPF 2D Game: Making a Camera that follows an object on a Canvas

I am trying to make a simple 2D Game in WPF, and I've come across a problem I can't solve. Let's say I have a player on a 700x700 Canvas, but my MainWindow's Width and Height are set to 400. I want to be able to have a camera like feature, that…
k0ntrol
  • 17
  • 4
-1
votes
1 answer

Return rotated rectangle in Java

I'm using Java Rectangles in my game in order to check collision between objects (using the intersects() method). As far as I know, this cannot be done if one of the objects is rotated. Say, for example, one of the objects in the game is rotated…
Soni
  • 77
  • 1
  • 10
-1
votes
1 answer

I need a method to move a rectangle horizontally by an integer length with a parameter of type int

The method is only ment to change the attribute value and does not have to call any other methods such as Draw(). class Rechteck { int xPosition; int yPosition; int breite; int hoehe; String farbe; void…
user9682879
-1
votes
2 answers

find minimal number of rectangles to cover 2D point array

I am given an array of 2D points and the task is to generate a minimal list of rectangles, where all rectangles have the same size and orientation, which cover all 2D point positions and can overlap. So far, I have a rather unsatisfying solution,…
Aeonos
  • 365
  • 1
  • 13
-1
votes
2 answers

Collision Detection rectangle/rectangle algorithm

http://jeffreythompson.org/collision-detection/rect-rect.php I am trying to figure out the algorithm of the collision detection of the rectangle/rectangle with the rectangles' picture and code. According to Jeff Thompson's collision detection…
-1
votes
2 answers

Wrong result from Rectangle.contains() in java

It appears that the contains() method in Rectangle is not inclusive to the bottom right corner. For example the following code returns "false"; Rectangle r = new Rectangle(0,0,100,100); System.out.println(r.contains(100, 100));
Maxwell
  • 133
  • 1
  • 7
-1
votes
1 answer

How can I deal with overlapping rectangles?

I am comparing two images and find the difference using compare_ssim, in that case I got the contours of differences, which i need to highlight by drawing rectangle around it, but I am facing the issue that some of the rectangles overlapping each…
Alpha Romeo
  • 84
  • 10
-1
votes
1 answer

Creating a Grid with rectangles

I'm trying to create a grid of rectangles but not sure how to go from here? I also don't know if this is right so far public CGOL (int x, int y, int size, int squares1) { numberOfSquares = 100; isAlive = new boolean…
-1
votes
1 answer

How do i get the color from Rectangle in fill property?

I know how to set fill from WPF control. Rectangle a = new Rectangle() a.Fill = Brushes.Red; but i can't get the color. i want code like this. string color = a.Fill; // Red var color2 = a.Fill(T); // Brushes.Red var color3 = a.Fill; // other…
ijaewung
  • 53
  • 1
  • 8
-1
votes
1 answer

Check if a list of points is part of a rectangle

I have a list of points and I need to find if the points exist in a rectangle defined by the top-left and bottom-right corners. If all the points belong in the rectangle then the result is True, otherwise the result is False. Here is my code but I…
DigiMon
  • 17
  • 1
  • 3