Mathematica Question
- To: mathgroup at smc.vnet.net
- Subject: [mg123493] Mathematica Question
- From: Thomas Howard <thomaswhoward at gmail.com>
- Date: Fri, 9 Dec 2011 05:54:34 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
Problem: Given the coordinates of a point (x,y) find the closest point
on the following curve (using jpg file of the image) and report its
coordinates.
The graph has x in [0,1.96875] and y in [-.96875,.96875]
(fractal starting at coordinates (0,0) and in each step it halves the
length of the line segment).
Mathematica has the command that finds the points closest to (2,3)
from a given list of points {(-1,1),(1,-1),(1,1),(-1,1)}:
In: Nearest[{{-1,-1}, {1,-1},{1,1},{-1,1}},{2,3}]
Out: {1,1}
It also has a command that finds the distance from each pixel in an
image to the nearest background pixel and replaces the color of the
pixel by its distance.
In:
Out[1]=