펄, 86 바이트
$y=1-$_/25,say+map$y**3*($_*=$_/1e3)-($_+$y**2-1)**3>0?$|--?v60:3:$",-40..40for-6..50
로 실행하십시오 perl -E
.
첫 번째 방정식을 사용하여 채워진 ASCII 하트를 플로팅합니다. x 축은 ~ 1.265의 계수로 확장됩니다. 이는 터미널 글꼴이 일반적으로 수평보다 수직으로 훨씬 크다는 사실을 방지하기위한 것입니다.
산출:
3<3<3<3<3<3<3< 3<3<3<3<3<3<3<
3<3<3<3<3<3<3<3<3<3< 3<3<3<3<3<3<3<3<3<3<
3<3<3<3<3<3<3<3<3<3<3<3< 3<3<3<3<3<3<3<3<3<3<3<3<
3<3<3<3<3<3<3<3<3<3<3<3<3<3< 3<3<3<3<3<3<3<3<3<3<3<3<3<3<
3<3<3<3<3<3<3<3<3<3<3<3<3<3<3< 3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<
3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3 <3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<
3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3
<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<
3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3
<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<
3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3
<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<
3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3
<3<3<3<3<3<3<3<3<3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3<3<3<3<3<3<3<3<3<3<3
<3<3<3<3<3<3<3<3<3<
3<3<3<3<3<3<3<3
<3<3<3<3<3<
3<3<3<3
<3<3<
3
설명 (OP가 요청한 이후) :
condition := $y**3*($_*=$_/1e3)-($_+$y**2-1)**3>0
이것은 단순히 첫 번째 방정식으로, 짧게하기 위해 약간 재정렬되었습니다. $ y는 수식에서 y를 직접 나타냅니다. $ _는 처음에 x에 비례하지만 x (x)에 곱하여 $_*=$_/1e3
x²에 비례합니다. x²은 수식에서 두 번 사용되므로 몇 바이트가 절약됩니다.
1e3
1000을 의미하며 짧고 결과가 좋아 보이기 때문에 선택되었습니다. **
Perl의 전력 운영자입니다. 나는 채워진 마음을 원 하기 >0
보다는 오히려 사용 ==0
합니다.
flip_flop := $|--?v60:3
v60은 ASCII 코드 60 : '<'으로 문자를 표시하기 위해 구식 버전 문자열 구문을 남용합니다.
$ | 0 또는 1 만 가능한 마법 변수입니다. 이미 0 인 경우 감소하면 1로 설정됩니다. 1 인 경우 감소하면 자연적으로 0으로 설정됩니다. 따라서 $ |-는 종종 플립 플롭으로 사용됩니다. 평가되고 true와 false가 교대로 나타납니다.
전체적으로이 표현식은 대안 적으로 '<'와 3을 반환합니다.
inner_loop := <condition> ? <flip_flop> :$"
중첩 된 삼항. 조건이 거짓이면 (→ 우리는 마음 밖에 있습니다) $ "로 평가합니다. 기본 변수는" "(단일 공간)으로 기본 설정되는 마법 변수입니다. 조건이 참이면 (→ 우리는 마음 안에 있습니다) flip_flop를 평가합니다.
outer_loop := say+map <inner_loop> ,-40..40
$ _ (Perl의 "default"변수)가 -40에서 40으로 1 씩 증가하면서 inner_loop를 반복적으로 평가합니다. 평가 결과를 임시 목록으로 수집 한 다음 연결하여 모두 새 줄로 끝나도록 인쇄합니다. .
$y=1-$_/25, <outer_loop> for-6..50
이것은 $ 4가 1.24 (1-(-6/25))에서 -1 (1-50 / 25)로 0.04 씩 감소하면서 outer_loop를 반복적으로 실행합니다.
y를 25로 나누고 x²을 1000으로 나누면 x를 sqrt (1000)로 나누는 것과 같습니다. 내가 언급 한 ~ 1.265 요소는 sqrt (1000) / 25입니다.