square

Stacking rectangles to into the most square-like arrangement possible

My Situation I have a N rectangles The rectangles all have the same shape (for example 2 inches wide x 1 inch tall) - Let's refer to this size as Sw and Sh for the width and height I want to position these rectangles in a grid such that the rects completely on top and next to each other - like what you would see in a spreadsheet What ...

Split square into small squares

Hi all, I have big square. And I would like to split this square into small squares. I need all possible combinations. I know that there are infinity count of combinations but I have one limitation. I have fixed size for smallest square. I can implement it using brute force. But it is too long. Is any preferable algorithm for this tas...

Detect if line segment intersects square

Anyone have a simple algorithm for this? No need for rotation or anything. Just finding if a line segment made from two points intersects a square ...

Power in sparql and other math functions

Hi I am trying to write a sparql query where I want to filter on the square of something, but I am simply unable to figure out how to square a number (x^2) (except by multiplying it with itself of cause.) I guessed a square root function called math:sqrt() which works, yet nothing like math:pow seems to exist. How do I get the square o...

Matplotlib square boxplot

Hi all, I have a plot of two boxplots in the same figure. Due to style reasons, the axis should have the same length, so that the graphic box is squared. I tried to use the set_aspect method, but the axis are too different by means of range and the result is terrific. Is it possible to have 1:1 axis even if they have not the same numbe...

PHP square instructions not Algebra

I am creating an array named "fifty" with 50 elements. Instruction #1:Initialize the array so that the first 25 elements are equal to the square of the index/key variable. When squaring we are raising a base or number to some power so in PHP we need some function like this: <?php print pow(10,2); // Squared raised to the 2nd power...

How do I detect squares/rectangle or an other shape with EMGU CV?

I want to make an apps detect an square/rectangle in my webcam using EMGU CV (an OPENCV wrapper). The square/rectangle will have a solid color. if it's posible I would like to obtain the width and heigth of the square/rectangle In this video you can see what I would like to do. http://www.youtube.com/watch?v=ytvO2dijZ7A&amp;NR=1 I'm w...

ImageMagick - Resize image to square.

Hey S.O. People I have just started doing some ImageMagick work. I am currently trying to convert an image from a file size that is almost square (1411 x 1486) or similar sizes to a square shape, like 1024x1024 unfortunately the resize function doesn't seem to do a resize of the canvas so i keep getting number like 1024x982. I am wonder...

Reducing Mean Square Error

The topic of mine is face recognition using artificial neural networks using MATLAB code. I tried my work by taking the images from web and started implementing the program by using neural networks. By typing nprtool command in MATLAB ,i started training, testing and validating the images from database. When i started to calculate the...

how check mdi child already running?

please help me.. i have a project use mdi application. my question is, how to check mdi child already running or not..? please help me.. ...

How could I check if a number is a perfect square?

I'm pretty stumped with this one guys. I'm trying to toy with Python (as you can see with my previous questions) so I'd really love some help here. :P Speeds is of no concern for now, just working. Thanks! Edit: I ended up doing it this way: def isSquare(number): temp = math.sqrt(int(number)) if "." in str(abs(int(temp))...

Add kilometers to a map point

Good morning. I would like to know how do I add kilometers to a map point (latitude / longitude). For example: The city Jaraguá do Sul is in latitude -26.462049, longitude -49.059448. I want to add 100 kilometers up, down, and on the sides. I want to do a square and get the new points. How do I do that? I tried it: <?php $distance =...

Take input through Buttons in java

I understand that the title might not be descriptive enough, but I'm making a magic square game in Java and basically, I'm trying to replicate user input as found in the sudoku game here: http://www.websudoku.com/. What I have is a n x n grid of Buttons (not JButton) as the board and what I want the user to be able to do is when the use...

How do I recognize squares in this image?

Hey everyone, So I'm using openCV to do square recognition on this image. I compiled the squares.c file on an image that I took and here are the results: http://www.learntobe.org/urs/index1.php The image on the left is the original and on the right is the image that is a result of running the square detection. The results aren't...

square-root and square of vector doubles in C++

Hi, I'd like to calculate the square and square-root of a vector of doubles. For example given: vector<double> Array1(10,2.0); vector<double> Array2(10,2.0); for(unsigned int i=0; i<Array1.size(); i++) Array1[i] = sqrt(Array1[i]); for(unsigned int i=0; i<Array2.size(); i++) Array2[i] = Array2[i] * Array2[i]; Is the...

How do you square an uploaded photo without padding with white space, in C#?

In my site, users can upload photos. I currently compress and resize the photo to make sure they aren't huge files. But this creates photos that are of varying dimensions... which makes the site a bit "ugly" in my opinion. I'd like to ensure the thumbnails are square images, but not by using padding. It's ok if there is some loss of the...

Estimating the square root

Hello- I am writing an iPhone app that needs to calculate the square root of a number about 2000 times every 1/30th of a second. sqrt() works fine on a computer, but the frame rate drops to around 10 FPS on an iPhone or iPad, and I have already optimized the rest of the code. I have heard that this can be sped up dramatically by estimati...