@@ -330,13 +330,13 @@ vollmer_plot.list <- function(x, labels = NULL, add = FALSE, ngrid = c(5, 5, 5),
330330# ' balebrun_plot(Pair_from_pitch(Plane(0, 80), 10), "strike-slip", col = 2, add = TRUE)
331331# ' balebrun_plot(Pair_from_pitch(Plane(0, 10), 10), "horizontal flow", col = 3, add = TRUE)
332332balebrun_plot <- function (x , labels = NULL , main = " Dip-Pitch-Plunge Diagram" , extra_labels = TRUE , add = FALSE , ... ) {
333- stopifnot(is.Pair(x ))
334333 # plunge <- x[, "plunge"]
335- pitch <- Pair_pitch(x )
336- dip <- x [, " dip" ]
337-
338- crds <- .ternary_from_pitchdip(pitch , dip )
339-
334+ # pitch <- Pair_pitch(x)
335+ # dip <- x[, "dip"]
336+ #
337+ # crds <- .ternary_from_pitchdip(pitch, dip)
338+ crds <- .balebrun_coords(x )
339+
340340
341341 if (isFALSE(add )) {
342342 .ternary_plot(
@@ -380,6 +380,14 @@ balebrun_plot <- function(x, labels = NULL, main = "Dip-Pitch-Plunge Diagram", e
380380 invisible (crds )
381381}
382382
383+ .balebrun_coords <- function (x ){
384+ stopifnot(is.Pair(x ))
385+ pitch <- Pair_pitch(x )
386+ dip <- x [, " dip" ]
387+ .ternary_from_pitchdip(pitch , dip )
388+ }
389+
390+
383391.ternary_from_pitchdip <- function (pitch , dip ) {
384392 plunge <- plunge_from_pitchdip(pitch = pitch , dip = dip )
385393
@@ -424,13 +432,43 @@ balebrun_plot <- function(x, labels = NULL, main = "Dip-Pitch-Plunge Diagram", e
424432 }
425433
426434 # --- Constant pitch lines (pitch fixed, dip varies) ---
427- dip_corner <- cbind(1 , 0 )
435+ # dip_corner <- cbind(1, 0)
436+ # pitch_seq_s <- sort(pitch_seq)
437+ # pitch_seq_sr <- pitch_seq_s[-c(1L, length(pitch_seq_s))] # remove first and last line
438+ #
439+ # pitch_lines_sr <- .ternary_from_pitchdip(pitch_seq_sr, dip = 90)
440+ # graphics::segments(x0 = dip_corner[, 1], y0 = dip_corner[, 2], x1 = pitch_lines_sr[, 1], y1 = pitch_lines_sr[, 2], col = col, lty = lty, ...)
441+
428442 pitch_seq_s <- sort(pitch_seq )
429443 pitch_seq_sr <- pitch_seq_s [- c(1L , length(pitch_seq_s ))] # remove first and last line
430444
431- pitch_lines_sr <- .ternary_from_pitchdip(pitch_seq_sr , dip = 90 )
432- graphics :: segments(x0 = dip_corner [, 1 ], y0 = dip_corner [, 2 ], x1 = pitch_lines_sr [, 1 ], y1 = pitch_lines_sr [, 2 ], col = col , lty = lty , ... )
433-
445+ dip_seq2 <- seq(min(dip_seq ), max(dip_seq ), length.out = n_interp )
446+ dip_seq2 <- dip_seq2 [- c(1L , length(dip_seq2 ))] # remove first and last line
447+
448+ invisible (lapply(pitch_seq_sr , function (p ){
449+ pitch_lines_sr <- t(vapply(dip_seq2 , function (d ){
450+ pitch_lines_sr <- .ternary_from_pitchdip(p , dip = d )
451+ }, numeric (2 )))
452+ graphics :: lines(pitch_lines_sr [, 1 ], pitch_lines_sr [, 2 ], col = col , lty = lty )
453+
454+ })
455+ )
456+
457+ plunge_seq_s <- sort(plunge_seq )
458+ plunge_seq_sr <- plunge_seq_s [- c(1L , length(plunge_seq_s ))] # remove first and last line
459+
460+
461+ invisible (lapply(pitch_seq , function (pl ){
462+ crds <- t(vapply(pitch_seq , function (pi ){
463+ di <- dip_from_pitchplunge(pi , pl )
464+ .ternary_from_pitchdip(pi , di )
465+ }, numeric (2 ))
466+ )
467+ lines(crds [, 1 ], crds [, 2 ], col = col , lty = lty )
468+ }))
469+
470+
471+
434472 # --- Constant plunge lines ---
435473 # plunge_seq_s <- sort(plunge_seq)
436474 # plunge_seq_sr <- plunge_seq_s[-c(1L, length(plunge_seq_s))] # remove first and last line
@@ -458,6 +496,12 @@ balebrun_plot <- function(x, labels = NULL, main = "Dip-Pitch-Plunge Diagram", e
458496
459497 graphics :: text(dip_seq / 90 , 0 , rev(dip_seq ), pos = 1 , cex = 0.8 ) # dip
460498 }
499+
500+ A <- c(0 , 0 ) # left
501+ B <- c(1 , 0 ) # right
502+ C <- c(1 / 2 , sqrt(3 ) / 2 ) # top
503+ abc <- rbind(A , B , C )
504+ graphics :: polygon(abc )
461505}
462506
463507# ' Fabric Plot of Woodcock (1977)
0 commit comments