graphics3d – Using fewer mesh lines, 3D graphics

    I want to make the Final use fewer mesh lines, 
    the ideal version will look like the second image.
    Where the triangle shape is more clear and clean. Can anyone give me some advice on how to fix my code?

ex1 = ParametricPlot3D({(3 + Cos(v)) Cos(u), (3 + Cos(v)) Sin(u),
Sin(v)}, {u, 0, 2 Pi}, {v, 0, 2 Pi}, Boxed -> False, Axes -> False)

mesh = Import(Export(NotebookDirectory() <> “ex1.stl”, ex1))

edges = MeshPrimitives(mesh, 1)

Final = Graphics3D(Map(Tube(#, .05) &, edges((All, 1))),Boxed -> False)

First image

Second image

linear algebra – Can I use algebraic equality operation for parametric equations of lines?

I am working on below question from a linear algebra book that I am studying,

Suppose $X = X_0 + tV$ and $Y = Y_0 + sW$ are two parametric representations of the same line $l$ in $R^n$.

a. Show that there is a scalar $t_0$ so that $Y_0 = X_0 + t_0V$.

b. Show that $V$ and $W$ are parallel.

Because both equations are representation of the same line, can I claim that $X=Y$ or $X_0 + tV = Y_0 + sW$ in algebraic sense? Assuming it is possible I can prove (a) like this:

$$X_0 + tV = Y_0 + sW$$
$$Y_0 = X_0 + tV – sW$$

Since $W$ and $V$ are direction vectors of the same line, they are parallel, and I can say $W=cV$,

$$Y_0 = X_0 + tV – scV$$
$$Y_0 = X_0 + V(t – sc)$$

$t$, $s$, and $c$ are all scalars, so $t_0=t-sc$,

$$Y_0 = X_0 + t_0V$$

Here is my second question in regards to these proofs:

Using the same assumption that I can say $X=Y$ and the (a), I can prove (b) like this:

$$X_0 + tV = Y_0 + sW$$

Using (a) ($Y_0 = X_0 + t_0V$):

$$X_0 + tV = X_0 + t_0V + sW$$

$$W = frac{(tV – t_0V)}{s}$$

$$W = Vfrac{t-t_0}{s}$$

Which means $W$ is a scalar multiple of $V$ and are parallel.

When I am trying to prove (b) I am using my result from (a) ( $Y_0=X_0+t_0V$ ) which is concluded by the assumption that both vector directions $W$ and $V$ are parallel and infact in (b) I am trying to prove the same assumption that I made in (a) (that they are parallel). I am very new to this stuff and don’t know what technical term is used to describe this situation, but it kind of looks like chicken and eggs problem to me. Is there anything with the solutions that I provided?

How do I solve the insection of these two lines

2x + 4y = 8 and 6/x + 9y + 1 = 13. When I try and solve for x, I end up with the equation 3x^2-4x-4 when I want 3x^2+4x-4

javascript – Raycasting – weird lines on walls when ray is facing up or right

I am trying to make a raycasting game. Everything is rendered correctly except when the ray is facing up (angle > PI) or facing right(angle > 0.5PI and < 1.5PI) lines are drawn on walls. I am not sure what is causing it to happen but I know that the lines are not affected by the rotation of the player only by the players position. I also tried rounding the rays position but that did not help.

Right and up ray walls.
Text

The walls up close.
Text

Left and down ray walls.
Text

Code:

        let rayX, rayY, rayAngle, rayDeltaX, rayDeltaY

        for (let i = 0; i < this.screen.width; i ++) {
            rayAngle = this.angle - this.fov / 2 + i * (this.fov / this.screen.width)
            
            if (rayAngle < 0) {
                rayAngle += Math.PI * 2
            }
            else if (rayAngle > Math.PI * 2) {
                rayAngle -= Math.PI * 2
            }

            rayX = this.x
            rayY = this.y

            let stepY

            if (rayAngle > Math.PI) {
                stepY = -this.tileSize
                rayY = Math.floor(rayY / this.tileSize) * this.tileSize - 1
            }
            else {
                stepY = this.tileSize
                rayY = Math.floor(rayY / this.tileSize) * this.tileSize + this.tileSize
            }

            rayX = this.x  + (rayY - this.y) / Math.tan(rayAngle)
         
            rayDeltaY = stepY
            rayDeltaX = stepY / Math.tan(rayAngle)

            while(true) {
                if (this.Map.map(Math.floor(rayY / this.tileSize) * this.Map.width + Math.floor(rayX / this.tileSize)) == "https://gamedev.stackexchange.com/#") {
                    break
                }

                rayX += rayDeltaX
                rayY += rayDeltaY
            }

            let rayHorizontalX = rayX
            let rayHorizontalY = rayY
            let rayDistanceHorizontal = Math.sqrt((this.x - rayHorizontalX) ** 2 + (this.y - rayHorizontalY) ** 2)

            rayX = this.x
            rayY = this.y

            let stepX

            if (rayAngle > 0.5 * Math.PI && rayAngle < 1.5 * Math.PI) {
                stepX = -this.tileSize
                rayX = Math.floor(rayX / this.tileSize) * this.tileSize - 1
            }
            else {
                stepX = this.tileSize
                rayX = Math.floor(rayX / this.tileSize) * this.tileSize + this.tileSize
            }

            rayY = this.y + (rayX - this.x) * Math.tan(rayAngle)
    
            rayDeltaY = stepX * Math.tan(rayAngle)
            rayDeltaX = stepX

            while(true) {
                if (this.Map.map(Math.floor(rayY / this.tileSize) * this.Map.width + Math.floor(rayX / this.tileSize)) == "https://gamedev.stackexchange.com/#") {
                    break
                }
    
                rayX += rayDeltaX
                rayY += rayDeltaY
            }
            
            let rayVerticalX = rayX
            let rayVerticalY = rayY
            let rayDistanceVertical = Math.sqrt((this.x - rayVerticalX) ** 2 + (this.y - rayVerticalY) ** 2)
            
            let rayFinalDistance

            if (rayDistanceHorizontal < rayDistanceVertical) {
                rayFinalDistance = rayDistanceHorizontal
                ctx.fillStyle = 'darkblue'
            }
            else {
                rayFinalDistance = rayDistanceVertical
                ctx.fillStyle = 'blue'
            }

            let rayCorrectedDistance = rayFinalDistance * Math.cos(rayAngle - this.angle)

            let lineHeight = this.tileSize * (this.screen.width / 2 / Math.tan(this.fov / 2)) / rayCorrectedDistance
            let lineBottom = this.projectionPlane.centerY + lineHeight * 0.5
            let lineTop = this.projectionPlane.height - lineBottom

            ctx.fillRect(i, lineTop, 1, lineHeight)
        }

Any help would be appreciated.

digital – What are these lines in photos when viewed zoomed in on iPhone?

I take photos on my Canon (It happens on both my Canon EOS Rebel t1i and my Canon EOS R) camera then download them onto my iPhone. Then when I zoom in close enough, there are these invisible lines on the image (when you follow them along they form a 3×3 grid on the image).This happens in every single image that I download from my camera to my iPhone. What are they, and if possible, how can I fix them?

Uncropped:

Uncropped

Half-Way Zoomed In:

Half-Way Zoomed In

Fully Zoomed-In:

Fully Zoomed-In

python – Altair Scatterplot adds unwanted lines

When layered above a heatmap, the Altair scatterplot only seems to work if the point values are also on the axis of the heatmap. I any other case, white lines along the x and y-values are added. Here’s a minimal example:

import streamlit as st
import altair as alt
import numpy as np
import pandas as pd

# Compute x^2 + y^2 across a 2D grid
x, y = np.meshgrid(range(-5, 5), range(-5, 5))
z = x ** 2 + y ** 2

# Convert this grid to columnar data expected by Altair
source = pd.DataFrame({'x': x.ravel(),
                     'y': y.ravel(),
                     'z': z.ravel()})

c = alt.Chart(source).mark_rect().encode(
    x='x:O',
    y='y:O',
    color='z:Q'
)

scatter_source = pd.DataFrame({'x': (-1.001,-3), 'y': (0,1)})
s = alt.Chart(scatter_source).mark_circle(size=100).encode(
x='x:O',
y='y:O')

st.altair_chart(c + s)

Result

Is there any way to prevent this behavior? I’d like to animate the points later on, so adding values to the heatmap axis is not an option.

Own lines in Chrome prediction (Omnibox addressbar autocomplete)

I would like to get predictions from my intranet-wiki into chrome.

In this example I type "teame" and get some results for "teamevent"

intranet-results-in-chrome-prediction

How could I integrate our cooperate intranet/wiki there?

several times a day my pages come in written lines, clearing the cache helps, what goes wrong

several times a day my pages come in written lines, clearing the cache helps, what goes wrong
magento 2.2.5

enter image description here

What causes these lines? Could this be the moire effect or halftone? help!

I was wondering what causes those symmetrical lines seen at the edge of the hat? This is a screenshot from a video and I was also wondering what could the camera be? I am assuming this is an effect from an older kind of camera but I am not too sure.
enter image description here

plotting – Why “Joined” does not draw all the lines?

I’m working on a project in order to plot a graphical method for finite-difference equations called cobweb method. The next figure was succesful try for

$$x_{t+1} = Rx_t – frac{R}{2000}x_t^2$$

enter image description here

But, when I try with

$$x_{t+1} = cos{x_t},$$

and copy-paste the code I used before, the result was

enter image description here

For some reason Joined->True doesn’t draw all the lines. Changing a litle bit the number of point plotted, from 17 to 16, the figure is correct

enter image description here


There is a problem, but, where? My code is the following

difEqu(x_) := N(Cos(x))

traFin = {{0.4,0},{0.4,0.921061},{0.921061,0.921061},{0.921061,0.604976},
 {0.604976,0.604976},{0.604976,0.822516},{0.822516,0.822516},{0.822516,0.68038},
 {0.68038,0.68038},{0.68038,0.777334},{0.777334,0.777334},{0.777334,0.712786},
 {0.712786,0.712786},{0.712786,0.756543},{0.756543,0.756543},{0.756543,0.727213},
 {0.727213,0.727213},{0.727213,0.74703},{0.74703,0.74703},{0.74703,0.73371},
 {0.73371,0.73371},{0.73371,0.742695},{0.742695,0.742695},{0.742695,0.736649},
 {0.736649,0.736649},{0.736649,0.740724},{0.740724,0.740724},{0.740724,0.73798},
 {0.73798,0.73798},{0.73798,0.739829},{0.739829,0.739829},{0.739829,0.738584}}

extremos = {{0.4,0},{0.739829,0.738584}}

Show(
 Plot(
  Evaluate(
   {Legended(Style(difEqu(x), RGBColor(0., 0., 1.), Thickness(0.004)),"x(0) = 0.6"),
   Legended(Style(x, RGBColor(0., 0., 0.), Thickness(0.004), Dashed),"Identidad")}
  ),
 {x, 0, 1},
 PlotTheme -> "Scientific",
 ImageSize -> Large,
 PlotRange -> Full,
 FrameLabel ->
  {Style("x (t)", FontSize -> 35),
  Style("x (t+1)", FontSize -> 35)},
  LabelStyle -> {FontFamily -> "Arial", 20, RGBColor(0., 0., 0.)}
 ),
 ListPlot(
  {traFin, extremos},
  PlotStyle -> {{RGBColor(1., 0., 0.),Thickness(0.001)},{RGBColor(1., 0., 0.)}},
  Joined -> {True, False}
 )
)

I get traFin with another code. The number of iterations here is 16, i.e.

$$x_{16+1} = underbrace{x(x(cdots(}_{text{16 times}}0.4) = 0.738584.$$