473,587 Members | 2,447 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to find Length and Breadth of a Rectangle represented by co-ordinates

2 New Member
How to find Length and Breadth of a Rectangle represented by co-ordinates?
example:rectang le represented by (a,b) (c,d) (e,f) (g,h)
May 12 '10 #1
4 3113
Dormilich
8,658 Recognized Expert Moderator Expert
you can do it vector-like by computing the absolute of adjacent points
Expand|Select|Wrap|Line Numbers
  1.  x = | ⎛a⎞ – ⎛c⎞ |
  2.      | ⎝b⎠   ⎝d⎠ |
  3.  
  4. // x, =, – should be in the middle
May 12 '10 #2
babusek
2 New Member
hi Dormilich,
can you please explain your solution a bit.
Thanks,
Sekhar
May 13 '10 #3
jkmyoung
2,057 Recognized Expert Top Contributor
Find the length of (a,b) to (c,d)
Find the length of (c,d) to (e,f)

One is the length and the second is the breadth
May 13 '10 #4
Glenton
391 Recognized Expert Contributor
Do you know whether the points are in order? (a,b) to (c,d) might be a diagonal?
Do you know whether the points are, in fact, a rectangle?

If you know that it's a rectangle, but don't know what order the points are in, you could find three lengths from (a,b) to the other three points
{hint: length = sqrt((a-c)^2+(b-d)^2)}
and then the shortest is the breadth, the middle is the length and the longest is the diagonal.
May 19 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
2022
by: Jack | last post by:
Hello, What function can get a string's long by JavaScript? Thank you
3
2458
by: | last post by:
I am having a hard time understanding the logic behind the Rectangle object. My problem has to do with the way the rectangle treats the "Width" property. For example, take the following rectangle object. Rectangle myRec = new Rectangle(0, 0, 2, 2); If you draw this rectangle on the screen you will end up with a rectangle like the one shown below (The character "X" represents a pixel used to draw the rectangle and the character "O" is...
9
5319
by: News | last post by:
I am new in using Python Anyone know how to implement breadth first search using Python? Can Python create list dynamically, I want to implement a program which will read data from a file and store each line into a list, is this possible? Please send mail to me at nickyncy@yahoo.com.hk or reply this mail Thanks a lot!
4
14962
by: cdrom205 | last post by:
static void MDString ( unsigned char *input) { MD5_CTX context; unsigned char digest; unsigned int len = sizeof(input);//strlen (const char*) md5.MD5Init (&context); md5.MD5Update (&context, input, len); // void MD5Update (MD5_CTX *context, unsigned char *input, unsigned
2
1541
by: John J. Lee | last post by:
OK, this is really a reminder to myself next time I forget where I set my PYTHONPATH and forget exactly how to invoke the GNU "find" command ;-) Hope somebody else finds it useful too find / -maxdepth 3 -size -100k -type f -exec grep -sli pythonpath '{}' \; The minus in '-100k' (meaning "less than 100k") seems to be
6
17302
by: finerrecliner | last post by:
hey everyone i'm trying to make a function that will return the length and width of a dynamically allocated 2D array. here's what i came up with to find width: int findWidth(int** matrix) { int width = 0;
2
3870
by: SSG | last post by:
In my database table , I have field to store the text,.. I am tryinf to find the length of the filed in ASP like below response.write len(rs("cname1")) It is displaying the value , when the data in the field is nonzero, it is not displaying anything if the filed is mty in table.. I cant understand y it is displaying the length as 0 , bcaz i want to
2
2222
by: mmkhan7 | last post by:
could any one tell me how can i find length of given string in VB
17
4008
by: mihiri | last post by:
Can we use array.length when we dont know lengt of array.I use C language
10
3690
by: sklett | last post by:
I have a situation where I'm getting in Image that has a gray (solid, same color) background with a smaller white rectangle inside. The position is not always the same. What I need to do is locate the postion and determine the size fo the white rectangle and then crop the image to leave only the white rectangle remaining. I'm very new to GDI+ and have really no idea where to start. Can anyone suggest a good way to accomplish this? ...
0
7924
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7854
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8219
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8349
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7978
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8221
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6629
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5395
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3845
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.