PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Thu Dec 13, 2018 11:23 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: finding a point on line
PostPosted: Tue Aug 24, 2004 6:31 am 
Offline
Forum Contributor

Joined: Mon Mar 22, 2004 3:35 am
Posts: 118
i have a line whose starting pointis
(23,56)
and its ending point is
(44,78)

suppose if there are 8 equal division on that line, so now i want to
find the point in terms of (x,y) which is 4 divisions away from start
point.

is there any php function which can do that for me.
or if anybody can tell me any code for doing that.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 24, 2004 9:03 am 
Offline
Forum Regular
User avatar

Joined: Tue Jul 16, 2002 4:19 pm
Posts: 524
Location: Uruguay -- Montevideo
I think is more a math (algebra?) question than a php one... Search for Euclides.!!!.. (http://www.cut-the-knot.org/triangle/n-parts.shtml)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 24, 2004 9:54 am 
Offline
Briney Mod
User avatar

Joined: Mon Jan 19, 2004 7:11 pm
Posts: 6445
Location: 53.01N x 112.48W
This might work.

Syntax: [ Download ] [ Hide ]
//divide the rise and the run by 8,

$rise = 78 - 56;

$run = 44 - 23;

$rise_segment = $rise/8;

$run_segment = $run/8;



$fourth_section_x = 23 + ($run_segment * 4);

$fourth_section_y = 56 + ($rise_segment * 4);

_________________
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group