----- Original Message -----
From: "Pablo Manalastas" <[EMAIL PROTECTED]>
To: "Philippine Linux Users Group Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, November 14, 2003 1:58 PM
Subject: Re: [plug] Re: Programming in the Philippines.


> Quoting fooler <[EMAIL PROTECTED]>:
>
> > two problems only need a formula and you need
> > c^2 = a^2 + b^2 to start with to solve that problem
> > and it can be done in one-liner code :->
>
> In Problem E, we are given the coordinates of the three
> vertices of a triangle, and we are asked to write a
> program that computes the coordinates of the incenter,
> the point of intersection of the angle bisectors.
> I needed two pages of handwritten formula derivation
> and a hand-drawn diagram, PLUS two pages of program code
> in C. This one is definitely not a one-liner.  Sorry.

doc :-> actually two liner here.. one line for the value of X and one line
for the value of Y... but i still consider this as one liner :->

here is the formula to find the coordinate of angle bisectors of a given
triangle for problem E:

(1) X = (a * x1 + b * x2 + c * x3) / (a + b + c)
(2) Y = (a * y1 + b * y2 + c * y3) / (a + b + c)

where:

(3) a = sqrt( (x3 - x2) ^ 2 + (y3 -y2) ^ 2 )
(4) b = sqrt( (x3 - x1) ^ 2 + (y3 - y1) ^ 2)
(5) c = sqrt( (x2 - x1) ^ 2 + (y2 - y1) ^ 2)

x1,y1 is the first point... x2,y2 is the second point... and x3,y3 is the
third point of a triangle

to become as one liner for the value of X and Y, just expand equation 1 with
equation 3, 4 and 5... same true with equation 2 :->

like i said... all you need is c^2 = a^2 + b^2  to start with to solve this
problem because this kind of a problem is too easy for an engineering
student or a bs math student :->


> > as what i saw from those 8 questions... all you need is a good
> > mathematician who knows to program to win that game :->
>
> And this is where the problem lies. In this country, there
> are not enough computer science students with the proper
> mathematics background to handle the difficult stuff.

that is absolutely true! :->

fooler.


--
Philippine Linux Users' Group (PLUG) Mailing List
[EMAIL PROTECTED] (#PLUG @ irc.free.net.ph)
Official Website: http://plug.linux.org.ph
Searchable Archives: http://marc.free.net.ph
.
To leave, go to http://lists.q-linux.com/mailman/listinfo/plug
.
Are you a Linux newbie? To join the newbie list, go to
http://lists.q-linux.com/mailman/listinfo/ph-linux-newbie

Reply via email to