Questions tagged [rectangles]

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

1373 questions
-1
votes
1 answer

Matlab: Calculate vector lengths between different points on a rectangle

I am interested in creating a Matlab script that will consider a rectangle and allow me to calculate the length of vectors between one point and several other points placed along the perimeter of the rectangle. For example, calculating the length of…
M Vaughan
  • 5
  • 4
-1
votes
1 answer

Excel VBA Code to input values into rectangles

Develop a VBA to create the values into the three rectangles and determine the intersection of the numbers. Example code for creating code. Public Sub call_shareRectangles() Call shareRectangles("inputRange", "C1") End Sub Private Sub…
orih
  • 11
-1
votes
1 answer

What is wrong with this simple circle/rectangle collision detection?

I have an issue with simple 2d collision detection with a circle and a rectangle. All the checker does is see if the center of the circle overlaps with any point on the rectangle. Heres the checker: boolean overlaps(Circle circle) { for…
-1
votes
1 answer

removing a rectangle from a jpanel using arraylist

'package javaapplication12; import java.awt.*; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.awt.geom.Ellipse2D; import java.awt.geom.Rectangle2D; import java.awt.geom.RoundRectangle2D; import…
Rehan
  • 3,813
  • 7
  • 37
  • 58
-1
votes
2 answers

Best way to draw simple rectangle in Qt

I am writing a little program in C++ with Qt. I have a QGridLayout with 3*3 QWidget. In each QWidget, I have a QVBoxLayout. Within that QVBoxLayout I need to put a certain number of black and white rectangles. For now, I use QWidgets for these…
Nono
  • 33
  • 7
-1
votes
1 answer

a function that return the intersection of two rectangles

Write a function, rec_intersection(rect1, rect2) and returns the intersection of the two. Rectangles are represented as a pair of coordinate-pairs: the bottom-left and top-right coordinates (given in [x, y] notation). Hint: You can calculate the…
user3597950
  • 9,201
  • 6
  • 26
  • 35
-1
votes
2 answers

string!! allow letter only for the first character of my rectangle names

I can't get the right output.. please help me.. and it should return false when I put number as the first character for the name like this , Enter the name of the first rectangle: rec 1a Invalid input. Type 'rec' following by the name or 'stop' if…
-1
votes
1 answer

C# How do I access the second half of the rectangle structure's coordinates

This may be a simple question but I can't seem to find the answer after googling or going on the MSDN! I have defined a rectangle using the following: gridSecondRect3 = new Rectangle(324, 172, 471, 304); I understand the first 2 number are the…
Rich
  • 15
  • 1
  • 9
-1
votes
2 answers

XNA - Intersecting classes - 2D

Okay, so I have been searching for hours without any results and really hope that you could help me. I'm having some trouble getting the intersect to work. Nothing happends when my classes collide which is probably me being blind but also really new…
Arvin Ashrafi
  • 621
  • 2
  • 7
  • 9
-1
votes
2 answers

How would I insert a string into a rectangle?

This is my code: package com.Bench3.simplyMining; import javax.swing.*; import java.awt.*; import java.awt.event.*; public class Keying extends JPanel { private static final long serialVersionUID = 1L; public Rectangle miningRock; …
-1
votes
1 answer

Imitating html's flexible rectangle

I want to imitate the well-known HTML's great great RECTANGLE. I mean all of the characteristic of the rectangles like borders, border-radius, triangulated quad on corners, etc. I don't like to use any other libraries except mine. I would like to…
mr5
  • 3,438
  • 3
  • 40
  • 57
-1
votes
4 answers

Where's the mistake in this geometric algorithm?

What's the mistake in this algorith? How can I resolve it? Eclipse tell me a mistake in the main on area c1 = new area(); import java.awt.Rectangle; public class ClasseRettangolo { public class area { Rectangle box = new Rectangle(5…
Vaiz
  • 1
-1
votes
1 answer

C++ intersection of two rectangles

I am having problems figuring out this part of the program: Write a non-member function, intersection() that takes two Rectangle parameters and returns a Rectangle containing the intersection of the two. Of course, if the two Rectangles don't…
user2904220
  • 7
  • 1
  • 2
-1
votes
2 answers

rectangle collision detection not working

i have a game with bullets and monsters wherein i need to release the bullets and monsters when they collided using rectangles however when the collision occurs the method is not returning true here is what i did: i set bounds for each…
NoobMe
  • 544
  • 2
  • 6
  • 26
-1
votes
1 answer

Set Background Image for RectangleGeometry in WPF?

I have this code:
LINH
  • 9
  • 1
  • 3