0
$\begingroup$

For a puzzle I want to list pairs of Chinese cities. Once a line is drawn between each pair of cities the resulting lines will spell out a phrase in Chinese which is the answer to the puzzle.

I've loaded and visualized the geodata using:

cities=CityData[{Large,"China"}];
coords=Map[CityData[#,"Coordinates"]&,cities]
Graphics[Map[Point[Reverse[#]]&,coords]]

I can't work out how to convert a Chinese character into a series of lines (I realise not all strokes in a character are straight but can they be approximated by one). I've tried rasterizing the character and using ImageLines to pick out the strokes but couldn't get it to work.

Once I have the data points for the end points of each line in the character I plan to get mathematica to search through linear transformations to find suitable transform between the end points of the lines to the coordinates of the cities and minimize the error.

So my question is how can I convert a Chinese character into an list of lines?

E.g. 水 into {{{.15,.25},{.4,.65}},{{.15,.65},{.4,.65}},{{.35,.22},{.49,.22}},{{.49,.22},{.49,.85}},{{.49,.65},{.8,.22}},{{.6,.55},{.75,.7}}}

(Note this was just my rough approximation done by hand)

$\endgroup$

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.