www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 1154c072b53e1d7e385f48690cc1614e44ad5ab7
parent ffdf57aafa63c15453813c8cbfb84c5fa915498f
Author: Georges Dupéron <jahvascriptmaniac+github@free.fr>
Date:   Wed, 26 Oct 2011 01:20:43 +0200

Code en commentaire pour générer un réseau de routes perpendiculaires.

Diffstat:
Mroads.c | 24++++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/roads.c b/roads.c @@ -394,12 +394,6 @@ typedef struct Map { // vertices. } Map; -void fv(Map* m, Vertex* v) { - // TODO : tracer une ou des routes, en utilisant segment_to - v=v; - m=m; -} - Vertex* vertex_init(Map* m, int x, int y) { // TODO : s'il y a déjà un point dans la case de la grille pour // `(x,y)`, le renvoyer sans rien modifier. @@ -430,6 +424,24 @@ Segment* segment_to(Map* m, Vertex* u, int x, int y) { return s; } +void fv(Map* m, Vertex* from) { + v=v; + m=m; + // Tracer une ou des routes, en utilisant segment_to. + + // Vertex existing = (v->s->u == from ? v->s->v : v->s->u); + + // Segment dans la continuation + // Vertex new1 = vertex_add(from, vertex_substract(from, existing)); // from + (from - existing) + // segment_to(m, from, new1.x, new2.y); + + // Segment perpendiculaire + // polar = ctp(from, existing) + // polar.angle += 90; + // Vertex new2 = ptc(polar); + // segment_to(m, from, new2.x, new2.y); +} + void segment_display(Segment* s) { printf("<line x1=\"%d\" y1=\"%d\" x2=\"%d\" y2=\"%d\" stroke=\"black\" />", s->u->x, s->u->y, s->v->x, s->v->y);