Post Reply 
Set theory program for hp prime?
09-30-2022, 06:02 AM (This post was last modified: 09-30-2022 06:05 AM by DrEureka.)
Post: #1
Set theory program for hp prime?
Hello, I wanted to know if you know of any program that allows me to do this type of joints, for the hp prime.

Thx!
More info = https://www.math.net/union or https://www.math.net/set-theory
Find all posts by this user
Quote this message in a reply
09-30-2022, 03:15 PM
Post: #2
RE: Set theory program for hp prime?
Do you just mean the Venn diagrams?

If so then you could use something like this, although I really hope there is a better way.

Code:
EXPORT RQST()
BEGIN
FOR Y FROM 0 TO 239 DO
FOR X FROM 0 TO 319 DO
IF (X-120)^2+(Y-120)^2<80^2 THEN
PIXON_P(X,Y,RGB(255,0,0));
END;
IF (X-180)^2+(Y-120)^2<80^2 THEN
PIXON_P(X,Y,RGB(0,255,0));
END;
 
IF (X-180)^2+(Y-120)^2<80^2 AND (X-120)^2+(Y-120)^2<80^2 THEN
PIXON_P(X,Y,RGB(0,0,255));
END;
 
  
END;

END;

END;
Find all posts by this user
Quote this message in a reply
09-30-2022, 03:30 PM
Post: #3
RE: Set theory program for hp prime?
(09-30-2022 06:02 AM)DrEureka Wrote:  Hello, I wanted to know if you know of any program that allows me to do this type of joints, for the hp prime.

Thx!
More info = https://www.math.net/union or https://www.math.net/set-theory
Prime has a union command

Syntax:
UNION(list1 or object1, ... list_n or object_n)

UNION concatenates the inputs, removing all duplicates.

Example:
UNION({1,2,3}, {2,4,8}, 10) → {1, 2, 3, 4, 8, 10}
Find all posts by this user
Quote this message in a reply
09-30-2022, 03:55 PM
Post: #4
RE: Set theory program for hp prime?
Not only UNION, there are INTERSECT and DIFFERENCE, too.
Arno
Find all posts by this user
Quote this message in a reply
09-30-2022, 03:57 PM
Post: #5
RE: Set theory program for hp prime?
(09-30-2022 03:15 PM)matalog Wrote:  Do you just mean the Venn diagrams?

If so then you could use something like this, although I really hope there is a better way.

Code:
EXPORT RQST()
BEGIN
FOR Y FROM 0 TO 239 DO
FOR X FROM 0 TO 319 DO
IF (X-120)^2+(Y-120)^2<80^2 THEN
PIXON_P(X,Y,RGB(255,0,0));
END;
IF (X-180)^2+(Y-120)^2<80^2 THEN
PIXON_P(X,Y,RGB(0,255,0));
END;
 
IF (X-180)^2+(Y-120)^2<80^2 AND (X-120)^2+(Y-120)^2<80^2 THEN
PIXON_P(X,Y,RGB(0,0,255));
END;
 
  
END;

END;

END;
I'll check it out, thank you very much. yes from venn diagram
Find all posts by this user
Quote this message in a reply
09-30-2022, 04:07 PM
Post: #6
RE: Set theory program for hp prime?
(09-30-2022 03:15 PM)matalog Wrote:  Do you just mean the Venn diagrams?

If so then you could use something like this, although I really hope there is a better way.

Code:
EXPORT RQST()
BEGIN
FOR Y FROM 0 TO 239 DO
FOR X FROM 0 TO 319 DO
IF (X-120)^2+(Y-120)^2<80^2 THEN
PIXON_P(X,Y,RGB(255,0,0));
END;
IF (X-180)^2+(Y-120)^2<80^2 THEN
PIXON_P(X,Y,RGB(0,255,0));
END;
 
IF (X-180)^2+(Y-120)^2<80^2 AND (X-120)^2+(Y-120)^2<80^2 THEN
PIXON_P(X,Y,RGB(0,0,255));
END;
 
  
END;

END;

END;

I ask you a question, do you have an example of use, how can I enter several variables? How can I discriminate by UNION, INTERSECT and DIFFERENCE? thanks again for sharing
Find all posts by this user
Quote this message in a reply
09-30-2022, 04:17 PM
Post: #7
RE: Set theory program for hp prime?
(09-30-2022 03:57 PM)DrEureka Wrote:  
(09-30-2022 03:15 PM)matalog Wrote:  Do you just mean the Venn diagrams?

If so then you could use something like this, although I really hope there is a better way.

Code:
EXPORT RQST()
BEGIN
FOR Y FROM 0 TO 239 DO
FOR X FROM 0 TO 319 DO
IF (X-120)^2+(Y-120)^2<80^2 THEN
PIXON_P(X,Y,RGB(255,0,0));
END;
IF (X-180)^2+(Y-120)^2<80^2 THEN
PIXON_P(X,Y,RGB(0,255,0));
END;
 
IF (X-180)^2+(Y-120)^2<80^2 AND (X-120)^2+(Y-120)^2<80^2 THEN
PIXON_P(X,Y,RGB(0,0,255));
END;
 
  
END;

END;

END;
I'll check it out, thank you very much. yes from venn diagram


This is a little more optimised, but there must be a much faster way of doing it:

Code:
EXPORT RQST()
BEGIN
LOCAL R=80^2;
LOCAL S:=0;
LOCAL T:=0;
LOCAL U:=0;
FOR Y FROM 0 TO 239 DO
U:=(Y-120)^2;
FOR X FROM 0 TO 319 DO
S:=(X-120)^2+U<R;
T:=(X-180)^2+U<R;
IF S THEN
PIXON_P(X,Y,RGB(255,0,0));
END;
IF T THEN
PIXON_P(X,Y,RGB(0,255,0));
END;
IF S AND T THEN
PIXON_P(X,Y,RGB(0,0,255));
END;

END;
END;
END;
Find all posts by this user
Quote this message in a reply
09-30-2022, 05:57 PM
Post: #8
RE: Set theory program for hp prime?
The way I showed earlier is customisable.

This will do a very similar thing, just less customisable, but much, much faster.

Code:
EXPORT RQST()
BEGIN
ARC_P(G0,120,120,80,0,360,{RGB(0,0,255,128),RGB(0,0,255,128)});
ARC_P(G0,180,120,80,0,360,{RGB(255,0,0,128),RGB(255,0,0,128)});
WAIT(-1)
END;
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)