Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #18626

Re: How does the algoritm look like in this scenario

From Martin Leese <please@see.Web.for.e-mail.INVALID>
Newsgroups comp.lang.javascript
Subject Re: How does the algoritm look like in this scenario
Date 2013-02-25 10:36 -0700
Organization A noiseless patient Spider
Message-ID <kgg7cq$fic$1@dont-email.me> (permalink)
References <kgfgj7$d9b$1@dont-email.me>

Show all headers | View raw


Tony wrote:

> Assume I have on the x-axes the display area from x=40 pixels to x=750 
> pixels
> If I now want to set a lot of point in this coordinate system.
> For example if I have x-value 0 this would be positioned  at x = 40 and
> x-value 800 would be positioned at x=750.
> So I have to transform my x value into the coordinate system where origo 
> for x is 40 and x max is 800.
> 
> I can't find a suitable algoritm that can transform my x values into 
> this coordinate system.

Well, I don't think you could have looked
very hard; it doesn't get any simpler than
this.  Try:

x' = m*x + c  where m and c are constants.

To find m and c plug in your boundary
values of x and x'.  This will give you two
equations in two unknowns, which you then
solve for m and c.

-- 
Regards,
Martin Leese
E-mail: please@see.Web.for.e-mail.INVALID
Web: http://members.tripod.com/martin_leese/

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How does the algoritm look like in this scenario "Tony" <tony.johansson@inport.com> - 2013-02-25 12:07 +0100
  Re: How does the algoritm look like in this scenario Martin Leese <please@see.Web.for.e-mail.INVALID> - 2013-02-25 10:36 -0700
  Re: How does the algoritm look like in this scenario Gregor Kofler <usenet@gregorkofler.com> - 2013-02-25 18:36 +0100

csiph-web