Given the center and a point on the circle, you can use this formula to find the radius of the circle. Write a program that prompts the user to enter the center and a point on the circle. The program should then output the circle’s radius, diameter, circumference, and area. Your program must have at least the following functions: a. distance: This function takes as its parameters four numbers that represent two points in the plane and returns the distance between them. b. Radius : This function takes as its parameters four number that represent the center and a point on the circle, calls the function distance to find the radius of the circle. and returns the circle’s radius. c. Circumference : This function takes as its parameter a number that represents the radius of the circle and returns the circle’s circumference. (if r is the radius, the circumference is 2 π r) d. Area: This function takes as its parameter a number that represents the radius of the circle and returns the circle’s area. ( if r is the radius, the area is π r2 ) Assume that π = 3.1416
9 5532 Ganon11 3,652
Recognized Expert Specialist
Interesting problem. Were you having trouble with this? Did you have a program that you were getting errors on? Trouble understanding the problem? We can't help you if you won't help yourself.
Sounds like a program I did in my first programmer coures :P It's really not hard. There's algorithms on the net
WEll think about this for a moment..Now...I 'm assuming when you say the user enters the center and another point that this second point is on the edge of the circle (It has to be unless you're given a ratio of where it's located (e.g. the point is 2/3 away from the center)).
Anyways...Given the center and a point on the edge it's really easy to calculate the radius and diameter....Jus t calculate the length of the line...
AdrianH 1,251
Recognized Expert Top Contributor
i dont now any thing
I'm sorry? I think you know a lot more than you realise. You've got your problem, now tell me what steps you need to do to solve it.
Don't post code at this point. Assume that the computer is a person that will follow instructions. You talk to the person as input, the person does something and then talks back for output.
Now, what you need to think about is:  what are you going to say to the person?
 what is the person going to have to do (i.e. what calculations will it need to do)?
 what is the person going to say to you?
Frame your solution like:
person says, "What is the mass in grams?"
you say, "<some number>"
person stores m=<some number>
person calculates E=m*(c^2) where ^ means to the power of
person says "The energy in " m " grams is " E " Joules"
Adrian
Motoma 3,237
Recognized Expert Specialist
i dont now any thing
LOL. In that case, you need more help than this forum will be able to provide.
Given the center and a point on the circle, you can use this formula to find the radius of the circle. Write a program that prompts the user to enter the center and a point on the circle. The program should then output the circle’s radius, diameter, circumference, and area. Your program must have at least the following functions: a. distance: This function takes as its parameters four numbers that represent two points in the plane and returns the distance between them. b. Radius : This function takes as its parameters four number that represent the center and a point on the circle, calls the function distance to find the radius of the circle. and returns the circle’s radius. c. Circumference : This function takes as its parameter a number that represents the radius of the circle and returns the circle’s circumference. (if r is the radius, the circumference is 2 π r) d. Area: This function takes as its parameter a number that represents the radius of the circle and returns the circle’s area. ( if r is the radius, the area is π r2 ) Assume that π = 3.1416
OK, Let's get serious here....
Let us call your two points A and B. Your four numbers are then Ax, Ay, Bx, By. The length, L, of the line between these points is: ' Visual Basic
L = sqr( (Ax  Bx) ^ 2 + (Ay  By) ^ 2 )
/* C and C++ */
L = sqrt( pow( Ax  Bx, 2 ) + pow( Ay  By, 2 ) ) Since one of these points is the center of the circle and the other is on the circumference, this line is a radius of the circle. Therefore: radius = L
diameter = 2 * L
circumference = 2 * pi * L
area = pi * ( L ^ 2 ) See how easy this is?? Have fun with it.....
AdrianH 1,251
Recognized Expert Top Contributor
OK, Let's get serious here....
Let us call your two points A and B. Your four numbers are then Ax, Ay, Bx, By. The length, L, of the line between these points is: ' Visual Basic
L = sqr( (Ax  Bx) ^ 2 + (Ay  By) ^ 2 )
/* C and C++ */
L = sqrt( pow( Ax  Bx, 2 ) + pow( Ay  By, 2 ) ) Since one of these points is the center of the circle and the other is on the circumference, this line is a radius of the circle. Therefore: radius = L
diameter = 2 * L
circumference = 2 * pi * L
area = pi * ( L ^ 2 ) See how easy this is?? Have fun with it.....
Well saraaana, looks like JalapenoBob has given you part of the solution. Can you supply the rest?
Adrian
Sign in to post your reply or Sign up for a free account.
Similar topics 
by: Ron Adam 
last post by:
Hi, I'm having fun learning Python and want to say thanks to everyone
here for a great programming language.
Below is my first Python program (not my first program) and I'd
apreciate any feedback on how I might do things differently to make it
either more consice, readable, or faster. ie... are there better ways
to do it in Python?
It won't break any records for calculating pi, that wasn't my goal,
learning Python was. But it might...

by: FAQ server 
last post by:

FAQ Topic  How do I find the size of a browser window?

Where supported in NN: (>NN4.0)
var winWidth = window.innerWidth;
var winHeight = window.innerHeight;
Where supported in IE: (>IE4.0)

by: coolindienc 
last post by:
I converted this program from using global variables to local variables. When I did that my while loop stopped working in my main function(module). Anyone, any idea why? I underlined the area where I think the problem occured after my changes.
Old Code working FINE
from math import *
def menu():
global menuSel
print "\nSlect one of the following:"
print "1. Calculate Area of Rectangle"

by: coolindienc 
last post by:
I converted this program from using global variables to local variables. When I did that my while loop stopped working in my main function(module). Anyone, any idea why? I underlined the area where I think the problem occured after my changes.
Old Code working FINE
from math import *
def menu():
global menuSel
print "\nSlect one of the following:"
print "1. Calculate Area of Rectangle"

by: saggie 
last post by:
I cannot write this C program that uses a function to calculate the area of a circle, witha circle's circumference. This function (findArea) should call a second function (findRadius) which will return the radius of the circle. I need to show that the program can display the circles area on the screen.
The functions should only calculate the required information, they should not display. All display (printing to the screen) should be done in...
 
by: Greatness 
last post by:
Ceramic Floor Tile
You’re working for a company that lays ceramic floor tile, and they need a program that estimates the number of boxes of tile for a job. A job is estimated by taking the dimensions of each room in feet and inches, and converting these dimensions into multiple of the tile size (rounding up any partial multiple) before multiplying to get the number of tiles for the room. A box contains 20 tiles, so the total number needed...

by: Villanmac 
last post by:
Ahhhh, ive missed so many lessons this year that i have to try and teach myself c++ from a book and its so hard. Usually I just read this forums to pick things up but its doing my head in trying to work it out, so I thought I would sign up and ask some people who know what they doing.
Basically im trying to write a program that reads in the radius of a circle and prints its radius, diameter,circumference and area. It dosent seem that hard but...

by: Prime Mover 
last post by:
Hello all,
I have got the pseudocode below that I would like to convert to c
language. The algorithm calculates Pi value. I am somewhat familiar
with C language, but I am just starting to learn parallel programming.
In this specific example, the idea seems to be simple: one must
subdivide the main loop into pieces that can be executed by
independent "tasks" (computers??).
Then, each "worker task" executes a part of the loop a...

by: ofiras 
last post by:
In bitmap, how can I find the nearest pixel (pixel
1) to a specific pixel (pixel 2) that has different color from pixel
2? Or how can I find a pixel in a specific distance from pixel 2 (like
a circle that pixel 2 is his center, and I'm looking for a pixel that
has different color that pixel 2)?
(I'm trying to do a voronoi diagram maker, so I need to search for the
nearest colored pixel in my bitmap for every pixel that is not colored...

by: marktang 
last post by:
ONU (Optical Network Unit) is one of the key components for providing highspeed 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...

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,...
 
by: Oralloy 
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bitfields 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...

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...

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,...

by: isladogs 
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...

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();...

by: adsilva 
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
 
by: muto222 
last post by:
How can i add a mobile payment intergratation into php mysql website.
 